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. 例如:
运行时生成的原生html代码:
ngIf里包裹的input field:
[(ngModel)]="hero.name"展开成源代码:
【IT世界|Angular的ngIf和NgIf有何区别】ng-reflect-model=”Dr Nice“
推荐阅读
- 刘哥说游戏|国乒四大世界冠军收到国际乒联邀请,将参加世界杯!但却引起争议
- 快了棒棒糖|你知道几种?,世界各国的通用弹药
- 文峥解说|可以变身各种动物,我的世界:恶魔果实满足玩家各种“变身”梦
- 小D传奇解说|裁决骨玉要靠后,传奇世界:龙纹才是王者
- 游戏资讯小驿站|我的世界拔刀剑模组:独特设定!帮助玩家更深入了解刀的制作
- 新华网|专家:我国迎来成为新的世界贸易中心的历史性机遇
- 归处|世界上3个最美丽的火车站-你认为中国最漂亮的是哪个?
- 诗呓|拥有多个世界之最,让人大开眼界,却鲜少人知,贵州超低调的城市
- 央视新闻客户端|世界周刊丨特朗普疫苗计划争议连连美国“十月惊奇”要来了么?
- 人民币|摩根士丹利:人民币10年内将成为世界第三大储备货币
