IT世界|Angular的ngIf和NgIf有何区别

在Angular[官方文档](#asterisk)里 , 可以看到ngIf和NgIf这两种拼写混杂使用 。 NgIf refers to the directive class; ngIf refers to the directive's attribute name.
A directive class is spelled in UpperCamelCase (NgIf). A directive's attribute name is spelled in lowerCamelCase (ngIf). The guide refers to the directive class when talking about its properties and what the directive does.
The guide refers to the attribute name when describing how you apply the directive to an element in the HTML template. 例如:
IT世界|Angular的ngIf和NgIf有何区别运行时生成的原生html代码:
IT世界|Angular的ngIf和NgIf有何区别ngIf里包裹的input field:
[(ngModel)]="hero.name"展开成源代码:
【IT世界|Angular的ngIf和NgIf有何区别】ng-reflect-model=”Dr Nice“
IT世界|Angular的ngIf和NgIf有何区别


    推荐阅读