Below is the code of my view and an abstract of code in my controller.
View:
<div id="search_results" ng-controller="SearchCtrl">
<ul>
<li ng-repeat="result in results">{{result.name}}</li>
</ul>
</div>
Controller:
myapp.controller('SearchCtrl', function($scope,SearchF) {
$scope.launch_search = function() {
SearchF.update(function() {
$scope.results = SearchF.get();
});
}
})
The function .get() returns my data, but the view does not update. Looks like my scope ($scope.results) does not refer to the general scope. If I write the .update() block outside of the launch_search function, the view updates fine.
Any idea?
Thanks a lot everyone