0
点赞
收藏
分享

微信扫一扫

Angular给HTML节点绑定自定义属性和变量,用于设置一些动态的状态变化非常有用!


app.component.html 

<h1 [attr.color]="color">内容</h1>

app.component.ts

color='red';

app.component.scss

[color='red']{
color: red;
}

实际效果

Angular给HTML节点绑定自定义属性和变量,用于设置一些动态的状态变化非常有用!_自定义Angular属性

 

举报

相关推荐

0 条评论