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

ui-date should monitor $destroy #23

Closed
rwlogel opened this issue Jun 27, 2013 · 1 comment
Closed

ui-date should monitor $destroy #23

rwlogel opened this issue Jun 27, 2013 · 1 comment

Comments

@rwlogel
Copy link

rwlogel commented Jun 27, 2013

Within the ui-date directive it should have the following:

scope.$on('$destroy', function() {
    element.datepicker('destroy');
});

An easy way to detect if this is working is to put a ui-date into a ng-repeat. Unfortunately this fix also requires a fix in the angular.js code base issue 2658 (angular/angular.js#2658).

@petebacondarwin
Copy link
Member

Actually we should be watching the jQuery $destroy event instead. See http://plnkr.co/edit/KPYlpehlezXzgfQo4ZKy?p=preview.

element.bind('$destroy', function() {
  element.datepicker('destroy');
})

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

No branches or pull requests

2 participants