Angular Template တွင် Array Properties များ

HTML markup တွင်လည်း array များကို ပြသနိုင်သည်။ လက်တွေ့လုပ်ဆောင်ကြည့်ရအောင်။ ကျွန်ုပ်တို့တွင် အောက်ပါ array ရှိသည်ဟု ဆိုကြပါစို့:

app/app.component.tsexport class AppComponent {
  public arr: string[] = ['a', 'b', 'c'];
}

ကျွန်ုပ်တို့၏ array အတွင်းရှိ အကြောင်းအရာများကို markup တွင် ပြသကြပါစို့:

app/app.component.html<div>
  {{ arr[0] }}
  {{ arr[1] }}
  {{ arr[2] }}
</div>
Задание 1

အောက်ပါ array ကို ပေးထားသည်:

app/app.component.tsexport class AppComponent {
  public arr: number[] = [1, 2, 3, 4, 5];
}

ဤ array ၏ element တစ်ခုစီကို သီးခြား အပိုဒ်တစ်ခုစီတွင် ရိုက်ထုတ်ပြပါ။