Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #20 from sudhirrs/patch-1
Browse files Browse the repository at this point in the history
Added destroy handler to remove the select2 when the parent element is removed from DOM
  • Loading branch information
ProLoser committed Jun 26, 2013
2 parents bb23603 + 2fa72ef commit 380dc0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec
}
}
}

elm.bind("$destroy", function() {
elm.select2("destroy");
});

attrs.$observe('disabled', function (value) {
elm.select2('enable', !value);
Expand Down

0 comments on commit 380dc0d

Please sign in to comment.