# TypeScript Template Literal

Template Literal က string literal types တွေကို ပေါင်းစပ်ပြီး dynamic type တွေဖန်တီးနိုင်တဲ့ feature တစ်ခုပဲဖြစ်ပါတယ်။

<figure><img src="/files/myDU6Xstyu3hn2BbWowK" alt=""><figcaption></figcaption></figure>

Hello, နဲ့စမယ် ကြားထဲ ကြိုက်တယ့်စာသား String ကို အသုံးပြုနိုင်ပြီး နောက်ဆုံးမှာ (!) နဲ့ပိတ်မယ့် Template Literal Type လေးဖန်တီးကြည့်ပါမယ် ။

<figure><img src="/files/e5tdHPxEh6iUKpK9Bb2D" alt=""><figcaption></figcaption></figure>

Greeting Template Literal Type လေးဖန်တီးထားပါတယ် ။&#x20;

ပထမ helloWorld variable ကတော့ အဆင်ပြေပါတယ် ။&#x20;

ဒုတိယ wrongWorld variable ကတော့ "," "!" တွေ မပါဝင်တဲ့အတွက် Error Feedback ပြန်ရမှာ ဖြစ်ပါတယ်။

Union String Literal တွေ သုံးပြီးတော့လည်း ရေးသားနိုင်ပါတယ် ။

<figure><img src="/files/hKj5E9gqNG9sHt8LcFwg" alt=""><figcaption></figcaption></figure>

တကယ့်လက်တွေ့မှာ အသုံးပြုလေ့ရှိတယ့် Code Example fetchAPI ဆိုတဲ့ Function ကိုလေ့လာကြည့်ပါမယ် ။

<figure><img src="/files/pJ1hpJb3IlP42oifafwB" alt=""><figcaption></figcaption></figure>

ရေးထားတဲ့ Template အရ /api နဲ့စမှ မှန်ကန်မှာဖြစ်ပါတယ် ။<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lwin-moe-paing.gitbook.io/typescript-baby-by-lwin-moe-paing/other-topic/typescript-template-literal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
