add class to element angular in ts

Solutions on MaxInterview for add class to element angular in ts by the best coders in the world

showing results for - "add class to element angular in ts"
Josué
11 Jan 2020
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}
Victoria
22 Jan 2017
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
angular add class to dom element in componentangular 9 add classadd class tag html angularadd class in angular tsangualr add class to componentadd class to component in angularangular add class to html elementadd class angular to html add class angularjsadd class from angular componentadd class to angularsadd class for a div angularangular add class in componenthtml elemnt add class angularangular add class in divadd class in angular 10how to add class in angular 8angular add class by id using typescriptangular adding class to elementadd class to html element angularadd class to component angularadd class based on ts property in html angularadd class to div angularangular 10 add class in divadd class dynamically in angular using typescriptangularjs add class to elementadd class to element angular 12add class to element angular in tsadd class in angular 8class add in angularadd class angular 9add class angular componentadd class javascript angular 8 by idadd class using angular tshow to add class to angular componentadd class value from javascript angularangular code add class 23angular add class to element from codeaddclass in angularangular html element give class to html elementangular 8 add class to elementadd class to angular componentadd class to component through typescript angularangular add class to element in componentadd class to elementhtml angularadd class through angular in typescripthow to add class on div from component in angularadd class to div in angular 7add classes angularjsaddclass angular cssangular how to add a class to htmladd classes angularjangular add class to elementangular ng class add classadd class in angular jsangular add class programmaticallyangular class addangular cli add classadd classname to component angularadd new class on angular cliangular add class to element prograangular add a class ofadd class for element on html to ts angularangular add class to componentadd class to element using reference angular 2add class in typescript angularadd class for element on html to ts angular 11add class to element using angularangular component add classng add class to angularadd classname javascript angularangular add class to existing classhow to add class in particular element in angularangular add 5bclass 5dangular div add classadd class to element angularhow to add class to an element in angularangulas add class for an elementhow to add class in angular from tsadd class in angular by idangular div add class in typescriptadd class in angular in divhow to add new class through angular componentadd class in angularadd class via component in angularangular add class to element typescriptangular addclasshow to add class in angularjsangular add classadd new class on angular 12add class to div in angular 6angular add class to element from tsangular ways to add classadd css class to componnet angularadding class in angularadd class in angular 8 using typescriptangular add class documentadd class using angularangular add class to element from component tshow to add class to 3chtml 3e in angularadd class typescript angular 8 by idadd a class angularangular add classesangular add class to html tagaddclass in angular 7add class to element in angularadd class dynamically angularadd classname javascript angular targetangilar add classangular add class to element programmaticallyadd a class onto element angularjsadd class in ts angularadd class using angularjsadd class in angualrangular programmatically add classaddclass to element using angularangular add class to element from componentangular component get classes of hostadd class to element in typescript angularadd class to ng componentangular add class to dom elementangular typescript add class to elementangula addclasshow to add class name in angularadd class to element angular ts fileget class in component angular hostangular how to add class to componentadd class in angularjsaddclass angularhow to add class in angular 8 typescriptadd class to boy angularngclass add class to componentangular add class to divangular 2 add class to component add class angularangularjs add classhow to add class to angular component typescripthow add class to element html with angularhow to add class in angularadd class to element angular 9add class to element angular in ts