Page 1 of 1

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

Posted: Sat Apr 02, 2016 8:38 am
by taucher

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,


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

Posted: Mon Apr 04, 2016 3:49 pm
by Serhii Kulibaba

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...


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

Posted: Mon Apr 04, 2016 4:07 pm
by taucher

Hello Sergiy,

I am using :

code

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

/code

for now. There is no problem.

Thanks,