angular-ui / ui-select

AngularJS-native version of Select2 and Selectize
MIT License
3.26k stars 1.82k forks source link

Should clean up the handlers when destroyed #25

Closed tkrotoff closed 10 years ago

tkrotoff commented 10 years ago

Something like:

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

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

tkrotoff commented 10 years ago

b9288bf234b55b0b3c6c348951b4ef2e030e4c0b

kadamwhite commented 10 years ago

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 commented 10 years ago

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