I am implementing dropdown filters for user selection in my Angular application. The logic for adding classes with ngClass is present in the template:
<div [ngClass]="i > 2 && 'array-design'">
How can I transfer this logic to the controller for better unit testing capabilities?
<ng-container *ngIf="searchFilters.length > 0; else loading">
<div class="filter-items" *ngFor="let filter of searchFilters; index as i">
<div [ngClass]="i > 2 && 'array-design'">
<app-multi-select [items]="filter.navigators" [title]="filter.name"></app-multi-select>
</div>
</div>
</ng-container>
.scss
.cross-reactivity, .array-design{
display: flex;
flex-direction: row;
align-items: center;
margin-right: 5px;
}