Reactive-Extensions / rx.angular.js

AngularJS Bindings for RxJS
Other
827 stars 89 forks source link

fix safeApply when scope is destroyed #111

Closed PaulGiletich closed 8 years ago

PaulGiletich commented 8 years ago

When $scope is destroyed, its $root sets to null and safeApply throws Uncaught TypeError: Cannot read property '$$phase' of undefined.

My proposition is to dispose safeApply observable when $scope is '$$destroyed' as there is no much sense in updating destroyed scope

PhiLhoSoft commented 8 years ago

Or maybe safeApply should stop to use $$phase and similar hacks, which is discouraged (using non-official internal code), and should use $evalAsync instead...

PaulGiletich commented 8 years ago

Yes we can, but $evalAsync or $applyAsync would not perform as fast as $$phase checking