ng-style用法

来源:互联网 发布:网红开的淘宝店有哪些 编辑:程序博客网 时间:2024/06/05 09:30

我想给ng-style传一个controller里面的变量,折腾了半天,引号不能忘

ng-style="{'background-color':'{{markColor}}'}"

Since some CSS style names are not valid keys for an object, they must be quoted. See the ‘background-color’ style in the example below.

还有一个问题,string.repalce is not a function,这个貌似是因为要初始化.
myStyle = {};
ng-style=”myStyle”

0 0
原创粉丝点击