angular progress bar using ng-style goes back

时间:2016-03-02 11:00:44

标签: css angularjs

I have issue with ng-style and progress bar

I'm using file uploader module from the following link : https://github.com/nervgh/angular-file-upload

The issue is the progress bar goes back with the animation instead of starting from 0.

I checked the values and it does start from 0, than progress until 100, but the progress looks like it goes back.

Not sure what am i doing wrong,

If you have any idea, please share it with me.

I attached animated gif to show the scenario

and my html code:

<div ng-if="item.progress <= 100" class="upload-progress-bar">
<div class="progress-bar" ng-style="{ 'width': item.progress + '%' }"></div>
</div>

enter image description here

I also tried to move the ng-style to a function on the controller,

or add nt-init to the html like that:

<div class="progress-bar" ng-style="{ 'width': item.progress + '%' }" ng-init="item.progress = 0"></div>

but it didn't solve the issue.

1 个答案:

答案 0 :(得分:0)

感谢您的帮助 通过删除

解决了这个问题
track bv $index
来自ng-repeat的

我不确定导致这个问题的原因是什么,但这是解决它的问题。