From 72fc318d67cde4b79b6e4600d57880913094911c Mon Sep 17 00:00:00 2001 From: Ryan Schmukler Date: Tue, 1 Dec 2015 21:50:28 -0600 Subject: [PATCH] amend(select): fix bug introduced by accessability fixes --- src/components/select/select.js | 5 +++-- src/components/select/select.spec.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/select/select.js b/src/components/select/select.js index 6108031fd24..eaa09ef95e1 100755 --- a/src/components/select/select.js +++ b/src/components/select/select.js @@ -173,12 +173,13 @@ function SelectDirective($mdSelect, $mdUtil, $mdTheming, $mdAria, $compile, $par // Use everything that's left inside element.contents() as the contents of the menu var multiple = angular.isDefined(attr.multiple) ? 'multiple' : ''; + var modelBinding = angular.isDefined(attr.ngModel) ? 'ng-model="' + attr.ngModel + '"' : ''; var selectTemplate = '' + ''; - selectTemplate = $mdUtil.supplant(selectTemplate, [multiple, element.html()]); + selectTemplate = $mdUtil.supplant(selectTemplate, [multiple, modelBinding, element.html()]); element.empty().append(valueEl); element.append(selectTemplate); diff --git a/src/components/select/select.spec.js b/src/components/select/select.spec.js index 60670ab60f9..6b112db4193 100755 --- a/src/components/select/select.spec.js +++ b/src/components/select/select.spec.js @@ -487,7 +487,7 @@ describe('', function() { })); - it('removing a valid value from the model deselects its option', inject(function($rootScope) { + iit('removing a valid value from the model deselects its option', inject(function($rootScope) { $rootScope.model = [2,3]; var el = setupMultiple('ng-model="$root.model"', [1,2,3,4]);