Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on navigating away from page #27

Closed
magistrula opened this issue Apr 27, 2014 · 10 comments
Closed

Error on navigating away from page #27

magistrula opened this issue Apr 27, 2014 · 10 comments

Comments

@magistrula
Copy link

The following error occurs when I navigate away from the page containing my media player. Note that I have set up my playlist using ng-repeat.

TypeError: Cannot read property '$$destroyed' of null
at g.$destroy (...angular.min.js:99:374)
at g.$broadcast (...angular.min.js:102:462)
at g.$destroy (...angular.min.js:99:412)
at g (...angular-route.min.js:6:251)
at ...angular-route.min.js:6:394
at ...angular.min.js:42:170
at s (...angular-route.min.js:6:378)
at g.$broadcast (...angular.min.js:102:462)
at ...angular-route.min.js:10:443
at z (...angular.min.js:91:280)

@cristiano-belloni
Copy link

+1

@colthreepv
Copy link
Owner

I would be happy to help, but add more details to the report.. this happens in normal pages or when navigating away views? (ex: using ui-router)

in the latter case a plunkr can be made up and would be really helpful to track down the issue

@cristiano-belloni
Copy link

navigating views, I'm fairly sure the culprit is scope.$on('$destroy', player.$destroy);

@cristiano-belloni
Copy link

Sorry, my error message was different. Will open a new issue.

@cristiano-belloni
Copy link

Managed to create a plkr for this bug (which seems somehow related to #38): http://plnkr.co/edit/6Ji1TtT10JyBe8GsQutc?p=preview

How to reproduce:
Click the /bug view link, then go back to the / view. See the TypeError: Cannot read property '$$destroyed' of null message.

@cristiano-belloni
Copy link

I suspect this happens everytime on scope destruction, but it is not easily seen because most scopes don't get destroyed during the lifetime of an angular app.

@sqrter
Copy link

sqrter commented Jun 8, 2014

+1

1 similar comment
@joe-schorn
Copy link

+1

@colthreepv
Copy link
Owner

Okey, coming back after some time to the lib, I think I am a douche.
player.$destroy was a method of the player in previous versions to clear the event listeners attached to the directive element.

I don't think it's necessary anymore, since if the element gets removed from the DOM, the event listeners attached to the DOM EL gets garbage collected.

So I assume I'll just remove the call and not try to fix it with something working.

To check if I did something wrong I'll have to profile the memory when creating/destroying multiple media player directives

@ghost
Copy link

ghost commented Jul 16, 2014

Sorry, I've been experiencing this error and haven't really seen the solution in the thread. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants