angular-phonegap icon indicating copy to clipboard operation
angular-phonegap copied to clipboard

Add $rootScope to service wrappers

Open mstaessen opened this issue 11 years ago • 1 comments

I was thinking the other night that it could be useful to include $rootScope in the service wrappers such that $scope.apply() can get called in the in the wrapper. This way, the module that uses the service does not have to call this anymore.

But I do think that $rootScope.apply() refreshes the entire scope (root + children) whereas $scope.apply only refreshes the current scope. This could introduce performance issues.

So I need to investigate this, unless somebody already did ;)

mstaessen avatar Mar 08 '14 15:03 mstaessen

There are no difference between calling $rootScope.$apply and $scope.$apply. If you want to update just current scope and all of it's childs then you need to use scope.$digest.

I don't see any problem with calling scope.$apply since event ngChange/ngKeyup/ngKeydow do this.

fesor avatar Oct 19 '14 13:10 fesor