taucher
Posts: 0
Joined: Fri Apr 17, 2015 6:06 am

[Ionic-Angularjs] "$scope.$apply()" Throws Error

Hello,

Do we need to add code $scope.$apply() /code after service mapping as shown in https://www.youtube.com/watch?v=0h1RbhwFjAw?

Without code $scope.$apply() /code, also mapping works but when i add it to end of mapping it throws error:
Image

Thanks,

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

[Ionic-Angularjs] "$scope.$apply()" Throws Error

Hello,

Please use that method in the case, what you need to refresh manually scope variable. So, if it works without that method - just don't use it.
http://www.sitepoint.com/understandin...
http://stackoverflow.com/questions/18...

taucher
Posts: 0
Joined: Fri Apr 17, 2015 6:06 am

[Ionic-Angularjs] "$scope.$apply()" Throws Error

Hello Sergiy,

I am using :

code

if(!$scope.$$phase) {
$scope.$apply();
}

/code

for now. There is no problem.

Thanks,

Return to “Issues”