Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

progress bar not stable #627

Open
tim7004 opened this issue Oct 24, 2017 · 2 comments
Open

progress bar not stable #627

tim7004 opened this issue Oct 24, 2017 · 2 comments

Comments

@tim7004
Copy link

tim7004 commented Oct 24, 2017

Dear all,
Below is my code:

function successGetData(data) {
    $scope.myData = data;
  }
  
  $scope.getUnMatchedBets = function () {
    var resource=$resource('http://example.com/content/testing_data.json',{},{'get':{method:'GET',isArray:true}})
  	$scope.promise = resource.get({}, successGetData).$promise;
  };

And the testing_data.json have about 2000+ records like:

[
 {
    "id": "59edac10fc7b1f45bb314977",
    "test_id": 1030000093877,
    "selection": "Selection_0",
    "payment": 7212,
    "risk": 17356,
    "price": 1.7963,
    "username": "Frazier Sherman"
  },
  {
    "id": "59edac1054ad8ba31502a727",
    "test_id": 1030000093878,
    "selection": "Selection_1",
    "payment": 9461,
    "risk": 19677,
    "price": 1.4711,
    "username": "Leigh Sharp"
  },
.....
]

I try to load and show all the data in the table, and it works.It takes about 5s to load all data. But I found that the progress bar has some problems. The progress bar almost reaches the end, it will go back again. It will keep doing the same action in this 5s.

Is it any wrong in my code? I simple using the sample html in the table.

Thank you.

@adsa95
Copy link

adsa95 commented Dec 17, 2017

If you look in the source template (src/templates/md-table-progress.html), you can see that this is because this libary uses the 'indeterminate' mode of the progress bar, which means it's only loading or not loading and doesn't update the progress bar to show the progress of the operation:
<md-progress-linear ng-show="deferred()" md-mode="indeterminate"></md-progress-linear>

There is nothing wrong with your code, it's just the way it works when using this library.

You can compare the different modes that is available in Angular Material in their documentation

@tim7004
Copy link
Author

tim7004 commented Dec 18, 2017

Thank you adsa95~
I found that it is because of ngRepeat rendering of large set of data. So it make the progress bar slow

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants