使用ng-style标记来替代style="{{ someCss }}"。对象
ng-style 属性值必须是对象,表达式返回的也是对象。class
写法1:scope
<div class='progress-bar' style="{'width':'{{percent}}%'}"></div>di
controller 中:co
$scope.percent = 40;controller
写法2:
<div class='progress-bar' style="barWidth"></div>
controller 中:
$scope.barWidth = {
'width' : '40%'
};