不显示角码绿色
app.component.css
.text-success{color:green}
app.component.html
<h2 [ngClass]='borde'>Hello World</h2>
showColor:true
public borde={text-success:this.showColor}
您未将showColor
设置为true。您将类型设置为true,但没有将值设置为true。如果将其更改为showColor = true
,它将正常工作。