showing results for - "angualr add class to component"
Nahel
02 Sep 2016
1@Component({
2   selector: 'app-your-component',
3   templateUrl: './your-component.component.html',,
4   host: {'class': 'your-class'}
5})
6export class YourComponent implements OnInit {
7...
8}
Federico
05 Jan 2020
1type one
2
3[class.my-class]="step === 'step1'"
4type two
5
6[ngClass]="{'my-class': step === 'step1'}"
7and multiple option:
8
9[ngClass]="{'my-class': step === 'step1', 'my-class2':step === 'step2' }"
10type three
11
12[ngClass]="{1:'my-class1',2:'my-class2',3:'my-class4'}[step]"
13type four
14
15[ngClass]="(step=='step1')?'my-class1':'my-class2'"
16
queries leading to this page
add classname javascript angularangular 2 add class to component angular add classangular add class to componentclass add in angularadd class to div angular renderehow to add class in angular 8angular add class domangular add class to element prograadd class to div in angular 6add classname to component angularadd class angular to html angular add class to divadd class based on ts property in html angularadd class to element angularjsaddclass angularget class in component angular hosthow to add a class through javascript angularangularjs adding classangular add class to elementhow to add class to an element in angularadd class in angularjsadd class to element in angularadd classes angularjsangular add class from typescriptadd class in angular jsangular add class to dom element in componentangular adding class to elementangular html element give class to html elementadd class in angular typscriptangular add class to element from componentangular typescript add class to elementadd class to element angularadd class to html element angularangular component add classangular add a class ofadd class in angular in divangular addclass angular 11add classes angularjhow to add class in angularjsadd class angular 12how to add class to angular component typescriptangular add classeshow to insert class into html angularadd class in angular 8angular programmatically add classhow to add class in particular element in angularadd class angular 9how to add class to angular componentadd class for a div angularadd class tag html angularhow to insert div by class name using typescript angularhow to add an element class via js angularangular add class to element from tsngclass add class to componentangilar add classangular add class to dom elementadd class through angular in typescriptangular how to add a class to htmladd class to element angular ts fileangula addclassangular add class to element from codeadd class from angular componentangular add class programmaticallyadd class for element on html to ts angular 11how to add class name in angularhow to add an item class angularadd class to element in angular 8add class in angular typscript by domangular add class in divhow to add class in angular 8 typescriptadd class in typescript angularhow add class to element html with angularangular code add class 23how to add new class through angular componenthow to add class names in to angular html ngclass add class valueadd class to element angular in tsangular 10 add class in divangular add class to element programmaticallyadd class to component in angularadd class to angularsadd a class angularangularjs add class to elementangular ng class add classadd class typescript angular 8 by idadd class for element on html to ts angularhow to add class in angularangular how to add class to componentangualr add class to componentangular add class documentadd class to component through typescript angularadd class javascript angular 8 by idangular div add class in typescriptangular class addangular addclassadd class in angular by idangular add class to element by idangular div add classangular cli add classadd class in angularhow to add class in angular from tsadd class in ts angularadd class to angular componenthow to add class on div from component in angularadd class from the dom angularangular component get classes of hostangular htmlelement add classng add class to angularangular how to add class from ts fileaddclass angular cssangular add class to html elementangularjs add classadd class in angualradd new class on angular cliadd class in angular 10add class via component in angularangular add class to existing classadd class value from javascript angularadd new class on angular 12addclass in angular 7add a class onto element angularjsadd class using angular tsadd class to div in angular 7added class to item in angular j sadd classname javascript angular targetadd class to element in typescript angularadd class angularadd class using angularadd class to boy angularangular add class from componentadd class to div angularangular 8 add class to elementadding class in angularadd class dynamically in angular using typescriptadd class dynamically angularangular add class to element in componentadd class angularjshow to set add class in div in angularangular 12 add class to elementangular add class to element typescriptadd class to ng componentadd a class in dom in angularangular 9 add classadd class to element angular 12add class to component angularhow to add class to 3chtml 3e in angularangular add class by id using typescriptadd class in angular tsangular ways to add classadd class to element using angularhtml elemnt add class angularaddclass in angularadd class angular componentadd class using angularjsaddclass to element using angularangular add class to html tagangular add class in componentadd class in angular 8 using typescriptangular add 5bclass 5dangulas add class for an elementadd class to elementhtml angularadd class to element angular 9add class to element using reference angular 2add css class to componnet angularaddclass in angulrangular add class to element from component tsangualr add class to component