0
votes

I have a list of components which I want to apply on it a specific layout, except the ones that have a specific name; those I want to apply on them a different class, so I did like bellow:

  <app-home-redirection-box *ngFor="let item of titleView"
    [ngClass]="item.title.toLocaleLowerCase().includes('monitoring')?'col-lg-6':'col-lg-6 col-md-6 col-sm-6 mb-2'"
    [title]="item.title" [view]="item.view!">
  </app-home-redirection-box>

But that way give only one class (the last one that verify the condition) and all the others class are being replaced by the last one while rendering the components, I don't understand why each component not getting its own css class!