What is the meaning of * in *ngFor in angular2?

前端 未结 5 2124
-上瘾入骨i
-上瘾入骨i 2021-01-01 09:20

What is the meaning of * before ngFor in following sample and why it is needed?

{{hero.
5条回答
  •  春和景丽
    2021-01-01 10:05

    When Angular sees the asterisk (*) in ngFor, it will use its DOM element as template to render the loop.

    {{ hero.name }}

    is equivalent to

    
    

提交回复
热议问题