Answers for "angular dynamic class"

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

Code answers related to "Javascript"

Browse Popular Code Answers by Language