Angular 2 why asterisk (*)

前端 未结 5 1618
谎友^
谎友^ 2020-12-02 11:52

In angular 2 document, * and template, we know that the *ngIf, *ngSwitch, *ngFor can be expanded to ng-template tag. My question is:

I think the ngIf or

5条回答
  •  渐次进展
    2020-12-02 12:37

    Angular treats template elements in a special way. The * syntax is a shortcut that lets you void writing the whole