Thuta Learning
ရှာဖွေရန်
BasicWeb Developmentintermediate

Intro to TypeScript

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

Angular မှာ TypeScript ကိုအဓိကအသုံးပြုပါတယ်။ TypeScript က JavaScript ပေါ်မှာ type system, interface, class structure စတာတွေ ထပ်ပေါင်းထားတဲ့ language ဖြစ်လို့ project ကြီးလာတဲ့အခါ mistake တွေကို စောစောဖမ်းနိုင်ပါတယ်။ အထူးသဖြင့် API data, form value, component input/output တွေမှာ type ထည့်ရေးခြင်းက code ကိုပိုယုံကြည်ရစေပါတယ်။

typescript
// TypeScript allows us to add types to our variables.
let name: string = "Angular";
let version: number = 16;
let isAwesome: boolean = true;

function greet(person: string): string {
    return "Hello, " + person;
}
You should see
(TypeScript သည် compile time တွင် error များကိုစစ်ဆေးပေးပြီး JavaScript သို့ compile လုပ်သည်)
Intro to TypeScript | Thuta Learning