I had a problem updating my list to ng-repeat in the view and in $ scope. $ Apply came to the rescue. Observers are bothering me. Is it good practice to use $ scope. $ Apply () often? Since I have a lot of views in the application that need to be updated immediately when the button is clicked.
PS: Any alternatives are welcome.
Sample JS code for my application:
function onRefreshList() { vm.showLoader = true; GetDataService.getVotes(someParams).then(function(res) { if (res){ vm.showLoader = false; vm.voteList = res;
HTML:
<div ng-show="showLoader"> <ion-spinner icon="android" class="spinner-assertive"></ion-spinner> </div> <div ng-show="!showLoader" ng-repeat="vote in votesCtrl.voteList"> {{vote}} </div>
source share