Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Don't run $apply if the scope was destroyed #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kayhadrin
Copy link

This can happen when the "stream" that triggers safeApply was completed after the scope was destroyed (e.g. the angular app was destroyed, which happens during jasmine unit tests)

Maybe we could also put a $destroy event listener to stop this observable as soon as it happens.

Right now, without this change, I would get an error like "TypeError: Cannot read property '$$phase' of null" when the angular app is already destroyed.

This can happen when the "stream" that triggers safeApply was completed after the scope was destroyed (e.g. the angular app was destroyed, which happens during jasmine unit tests)

Maybe we could also put a $destroy event listener to stop this observable as soon as it happens.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant