[ngStyle]="{'background-color':backgroundColor}"
注意:父组件引用的时候 外层记得加个引号 否则会以为是变量
[backgroundColor]='"#ccc"'
或者
backgroundColor='orange'
[ngStyle]="{'background-color':backgroundColor}"
注意:父组件引用的时候 外层记得加个引号 否则会以为是变量
[backgroundColor]='"#ccc"'
或者
backgroundColor='orange'