javascript - ng-repeat does not update view after ajax request -


here controller

app.controller('topicscontroller', ['api','$scope', function(api,$scope){   $scope.$on('loadtopics',function(){     api.topics.query(function(data){         $scope.topics=data;        console.log('topics loaded');      });  }); }]); 

html

    <div class="right_side" >          <aside class="user_tags" ng-controller="topicscontroller">          <h4>actual topics</h4>          <ul>              <li ng-repeat="topic in topics" ><a ui-sref="topicpage({tag:topic.tag})">{{topic.tag}}</a></li>          </ul>         </aside>     </div>  

the problem view updating on page reload, if ajax request called on page ( via button ex.), view not update. searched lot, tried $timeout , $apply, both haven't helped.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -