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 ):
NG0303: Can't bind to 'ngif' since it isn't a known property of 'div'.
I found this I should import commonModule in app.module.ts. 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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.