使用ng-style標記來替代style="{{ someCss }}"。
ng-style 屬性值必須是對象,表達式返回的也是對象。
寫法1:
<div class='progress-bar' style="{'width':'{{percent}}%'}"></div>
controller 中:
$scope.percent = 40;
寫法2:
<div class='progress-bar' style="barWidth"></div>
controller 中:
$scope.barWidth = {
'width' : '40%'
};
