Answers for "angular dynamic class"

2

Angular add class dynamically

<button 
  *ngFor="let button of buttons" 
  class="general" 
  (click)="ChangeScreen(button.label)" 
  [class.selected]="CurrentPage == button.label">
  {{ button.label }}
</button>
Posted by: Guest on June-23-2020
6

angular ngclass

content_copy
      
      <some-element [ngClass]="'first second'">...</some-element>

<some-element [ngClass]="['first', 'second']">...</some-element>

<some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element>

<some-element [ngClass]="stringExp|arrayExp|objExp">...</some-element>

<some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
Posted by: Guest on March-14-2020
0

angular dynamic class

<button [ngClass]="type === 'mybutton' ? namespace + '-mybutton' : ''"></button>
Posted by: Guest on February-22-2021
0

Angular add class dynamically

buttons: Array<{label: string}> = [
    {
      label: 'Global'
    },
    {
      label: 'Maintenance'
    },
    {
      label: 'Settings'
    },
    {
      label: 'Profile'
    },
    {
      label: 'Transactions'
    }
  ]
Posted by: Guest on June-23-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language