Answers for "ngstyle angular with scss variable"

0

ngstyle angular with scss variable

Mixin variables can't be used in the html template. 
As they are scss variables, you can only use them is your 
component.scss file.

Alternative:
html:

<div [ngClass]="step == 'step1' ? 'my_class1' : 'my_class2'"></div>

scss:
.my_class1 {
	background-color: $primary-color;
}
.my_class2 {
	background-color: $secondary-color;
}
Posted by: Guest on August-20-2021

Browse Popular Code Answers by Language