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

Commit

Permalink
fix(select): fix auto-complete element not being removed from form
Browse files Browse the repository at this point in the history
closes #5575
  • Loading branch information
rschmukler committed Nov 9, 2015
1 parent 6bf98aa commit 2760f67
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,12 @@ function SelectDirective($mdSelect, $mdUtil, $mdTheming, $mdAria, $compile, $par

if (attr.name && formCtrl) {
var selectEl = element.parent()[0].querySelector('select[name=".' + attr.name + '"]');
var controller = angular.element(selectEl).controller();
if (controller) {
formCtrl.$removeControl(controller);
}
$mdUtil.nextTick(function() {
var controller = angular.element(selectEl).controller('ngModel');
if (controller) {
formCtrl.$removeControl(controller);
}
});
}

if (formCtrl) {
Expand Down

0 comments on commit 2760f67

Please sign in to comment.