Search code examples
angularangular2-templateangular2-directives

*ngFor was working before I added bootstrap, and now everything is broken


Property binding ngForOf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations"

<div *ngFor="let post of posts" class="post-preview">
<h1 (click)="goToPost(post)" class="post-title">{{post.title}}</h1>
<p class="post-description">{{post.description}}</p>  </div>

everything was working fine before I added styling with bootstrap using

npm i -s bootstrap

Solution

  • after addition of bootstrap; I added imports: [CommonModule, ...], to my home module and things working again. before addition of bootstrap, i just imported CommonModule in app.module.ts