javascript - CSS not dynamically updating in AngularJS -
i'm trying make 2 div's width set angularjs value (0 - 100) did this:
<span class="green" ng-style="{width: '{{videorating}}%'}"</span> <span class="red" ng-style="{width: '{{100-videorating}}%'}"></span> but width calculated on initial value of videorating. when change value, won't update style.
any suggestions on how this?
i tried adding ng-cloak , $scope.$apply() no luck
ng-style should not use {{}} interpolation directive, use direct scope variables there.
markup
<span class="green" ng-style="{width: videorating + '%'}"</span> <span class="red" ng-style="{width: (100 - videorating) + '%'}"></span>
Comments
Post a Comment