Angular *ngIf 语法使用指令而不是字符串参数
Angular *ngIf syntax using directive and not a string parameter
我正在阅读 PluralSight 的 article on reactive forms 以恢复记忆,但我无法理解下面显示的语法。
<div *ngIf courseForm.get('courseName').valid && courseForm.get('courseName').touched>
Please enter valid course name !
</div>
我不能让它在我的电脑上运行,除非我改变我以前熟悉的语法,即传递一个字符串来评估真实性。
<div *ngIf="courseForm.get('courseName').valid && courseForm.get('courseName').touched">
Please enter valid course name !
</div>
如果它是 YAF 博客,我会把它归咎于作者的混乱 and/or 草率,但考虑到 PluralSight 的声誉,我很容易质疑我的能力。但是,我还没有找到任何关于新语法的文档,我有点困惑。 PluralSight 搞砸了吗?
这应该是一个错误,如果你看一下它所说的 ngIf
语法,
A shorthand form of the directive, *ngIf="condition", is generally
used, provided as an attribute of the anchor element for the inserted
template.
我正在阅读 PluralSight 的 article on reactive forms 以恢复记忆,但我无法理解下面显示的语法。
<div *ngIf courseForm.get('courseName').valid && courseForm.get('courseName').touched>
Please enter valid course name !
</div>
我不能让它在我的电脑上运行,除非我改变我以前熟悉的语法,即传递一个字符串来评估真实性。
<div *ngIf="courseForm.get('courseName').valid && courseForm.get('courseName').touched">
Please enter valid course name !
</div>
如果它是 YAF 博客,我会把它归咎于作者的混乱 and/or 草率,但考虑到 PluralSight 的声誉,我很容易质疑我的能力。但是,我还没有找到任何关于新语法的文档,我有点困惑。 PluralSight 搞砸了吗?
这应该是一个错误,如果你看一下它所说的 ngIf
语法,
A shorthand form of the directive, *ngIf="condition", is generally used, provided as an attribute of the anchor element for the inserted template.