我需要从Angular中的scss打开类。如何通过 @HostBinding 做到这一点?
下面的代码有效
scss:
.my-error {
color: red;
}
TS:
@HostBinding('class.my-error') errorOccur = true;
scss:
input {
&.my-error {
color: red;
}
}
TS:
@HostBinding('class.my-error') errorOccur = true;