There is another way to do the same using NgClass binding. Code 4.13 shows how to use NgClass based on condition: <span [ngClass]="selectedItem == item ?
確定! 回上一頁