Angular ရှိ Child Component သို့ Properties များလွှဲပြောင်းခြင်း
Parent Component ၏ Properties များကို Child Component သို့ လွှဲပြောင်းနိုင်ပါသည်။ အဆိုပါအလုပ်ကို မည်သို့လုပ်ဆောင်သည်ကို ကြည့်ရအောင်။ Parent Component တွင် ကျွန်ုပ်တို့ Child Component သို့ လွှဲပြောင်းမည့် Properties များကို သတ်မှတ်ပါမည်။
class AppComponent {
public name: string = 'john';
public age: number = 25;
}
Parent ၏ Template တွင် Attribute အမည်များကို ထောင့်ကွင်းစတုဂံများအတွင်း ရေးပါမည်။ ဤသို့ပြုလုပ်ခြင်းဖြင့် Attribute တန်ဖိုးအဖြစ်ရေးသားထားသောအရာသည် Parent Class ၏ Property အဖြစ် အဓိပ္ပာယ်ကောက်ယူခြင်းခံရမည်ဖြစ်သည်။
<user-data [name]="name" [age]="age"></user-data>
Parent Component တွင် ထုတ်ကုန်အမည်နှင့် ဈေးနှုန်းအတွက် Properties များ ပြုလုပ်ပါ။ ၄င်းတို့၏တန်ဖိုးများကို သင့် Child Component သို့ လွှဲပြောင်းပါ။