I want to "refresh" my view after some new data is loaded into my factory, but i cant figure out how to do this correctly.
$http.post(url, postKunde).success(function(data, status) {
$rootScope.calc = data.calc;
$rootScope.$apply();
}).error(function(data, status) {
console.log(status);
});
This is the method Im using in my factory. And everytime it triggers i get this error:
Error: $digest already in progress
Can anyone tell me how to do this correctly ? Thanks ...
$rootScope.$apply()call?$httpcallbacks are wrapped in a call to$apply()(or they call$apply), so you shouldn't need to call$apply()here.