[英]NG0303: Can't bind to 'ngif' since it isn't a known property of 'div'
I try to learn Angular with documentation but I have an error but this code work (I learn with this tutorial https://angular.io/tutorial/toh-pt4 ):我尝试使用文档学习 Angular 但我有一个错误但此代码有效(我通过本教程学习https://angular.io/tutorial/toh-pt4 ):
NG0303: Can't bind to 'ngif' since it isn't a known property of 'div'.
NG0303:无法绑定到“ngif”,因为它不是“div”的已知属性。
I found this I should import commonModule in app.module.ts.我发现我应该在 app.module.ts 中导入 commonModule。 But it doesn't work.
但它不起作用。 Why?
为什么? Do, you think that learning with offical documentation is good idea?
你认为通过官方文档学习是个好主意吗?
Please use the format like this:请使用如下格式:
<div *ngIf="condition; else elseBlock">
Content to render when condition is true.
</div>
<ng-template #elseBlock>Content to render when condition is false.
</ng-template>
Me paso algo similar lo que me faltaba era agregar el componente en declarations de modulo del componente Me paso algo similar lo que me faltaba era agregar el componente en declarations de modulo del componente
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.