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

Components

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

Component သည် Angular application ၏ အခြေခံအကျဆုံး building block ဖြစ်သည်။ Component တစ်ခုတွင် အပိုင်းသုံးပိုင်းပါဝင်သည်:

TypeScript Class: Component ၏ logic နှင့် data များ (properties & methods)

HTML Template: Component ၏ UI

CSS Styles: Component အတွက်သာသက်ဆိုင်သော styles များ

typescript
// user-profile.component.ts
import { Component } from '@angular/core';

@Component({
  selector: 'app-user-profile',
  templateUrl: './user-profile.component.html',
  styleUrls: ['./user-profile.component.css']
})
export class UserProfileComponent {
  username = 'John Doe';
}
You should see
(HTML template တွင် {{ username }} ကိုသုံးခြင်းဖြင့် 'John Doe' ဟုပြသမည်)
Components | Thuta Learning