如何使用angularjs uib-progressbar使用max value属性?

时间:2016-08-17 14:57:32

标签: javascript html angularjs progress-bar angular-ui-bootstrap

我想将最大值设置为200计数,当我收到消息时,它应该显示当前消息在进度条中计数,当我发送一条消息时,下面的代码整个进度条显示100%,它还显示进度条中的文本。有什么想法吗?

main.html中

<uib-progress><uib-bar ng-repeat="bar in event track by $index" max="max" value="bar"><span ng-hide="bar < 5">{{bar}}%</span></uib-bar></uib-progress>

ctrl.js

$scope.max = 200;
$scope.event = ["lorem ipsum","lorem ipsum","lorem ipsum"]

1 个答案:

答案 0 :(得分:1)

使用此max =&#34; {{max}}&#34;

<uib-progress><uib-bar ng-repeat="bar in event track by $index" max="{{max}}" value="bar"><span ng-hide="bar < 5">{{bar}}%</span></uib-bar></uib-progress>