javascript - angularjs - $http reading json and wait for callback -


i trying read data json , wait until data fetched $scope.urls.content. write code:

$scope.urls = { content:null}; $http.get('mock/plane_urls.json').success(function(thisdata) {     $scope.urls.content = thisdata;     }); 

and trying write callback doesn't work. how can that? or there function this? running out of ideas ;/

do mean ?

$http.get('mock/plane_urls.json').success(function(thisdata) {     $scope.urls.content = thisdata;     $scope.yourcallback(); }); $scope.yourcallback = function() {    // code }; 

Comments