Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Should clean up the handlers when destroyed #25

Closed
tkrotoff opened this issue Feb 17, 2014 · 3 comments
Closed

Should clean up the handlers when destroyed #25

tkrotoff opened this issue Feb 17, 2014 · 3 comments

Comments

@tkrotoff
Copy link
Contributor

Something like:

scope.$on('$destroy', function() {
  $document.off('click');
});

See Do event handlers need to be removed on directives when $destory fires?

@tkrotoff
Copy link
Contributor Author

b9288bf

@kadamwhite
Copy link

Does jQLite support event namespacing? The $document handlers should probably be namespaced, as-written there's a chance this could blow away other mindfully-bound document-level handlers

@tkrotoff
Copy link
Contributor Author

@kadamwhite no, see http://docs.angularjs.org/api/ng/function/angular.element on() - Does not support namespaces [...]

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

No branches or pull requests

2 participants