app.component.html
<h1 [attr.color]="color">内容</h1>
app.component.ts
color='red';
app.component.scss
[color='red']{
color: red;
}
实际效果
微信扫一扫
app.component.html
<h1 [attr.color]="color">内容</h1>
app.component.ts
color='red';
app.component.scss
[color='red']{
color: red;
}
实际效果
相关推荐