diff --git a/src/components/select/select.js b/src/components/select/select.js index 8754c8582a3..42a29cc06ff 100755 --- a/src/components/select/select.js +++ b/src/components/select/select.js @@ -71,7 +71,9 @@ angular.module('material.components.select', [ * * @param {expression} ng-model Assignable angular expression to data-bind to. * @param {expression=} ng-change Expression to be executed when the model value changes. - * @param {boolean=} multiple When set to true, allows for more than one option to be selected. The model is an array with the selected choices. + * @param {boolean=} multiple When present, allows for more than one option to be selected. + * The model is an array with the selected choices. **Note:** This attribute is only evaluated + * once; it is not watched. * @param {expression=} md-on-close Expression to be evaluated when the select is closed. * @param {expression=} md-on-open Expression to be evaluated when opening the select. * Will hide the select options and show a spinner until the evaluated promise resolves. @@ -83,7 +85,7 @@ angular.module('material.components.select', [ * will be treated as *html*. The value must either be explicitly marked as trustedHtml or * the ngSanitize module must be loaded. * @param {string=} placeholder Placeholder hint text. - * @param md-no-asterisk {boolean=} When set to true, an asterisk will not be appended to the + * @param {boolean=} md-no-asterisk When set to true, an asterisk will not be appended to the * floating label. **Note:** This attribute is only evaluated once; it is not watched. * @param {string=} aria-label Optional label for accessibility. Only necessary if no placeholder or * explicit label is present. diff --git a/src/components/select/select.spec.js b/src/components/select/select.spec.js index e5eab1e5bbb..3d68d8902b2 100755 --- a/src/components/select/select.spec.js +++ b/src/components/select/select.spec.js @@ -1014,7 +1014,7 @@ describe('', function() { $rootScope.model = []; $rootScope.opts = [1, 2, 3, 4]; $compile('
' + - '' + + '' + '' + '')($rootScope); $rootScope.$digest(); @@ -1078,7 +1078,7 @@ describe('', function() { $rootScope.model = [1, 2]; $rootScope.opts = [1, 2, 3, 4]; $compile('
' + - '' + + '' + '' + '')($rootScope); $rootScope.$digest(); @@ -1193,8 +1193,18 @@ describe('', function() { expect($rootScope.model).toEqual([1,3]); }); - it('should not be multiple if attr.multiple == `false`', function() { - var el = setupSelect('multiple="false" ng-model="$root.model"').find('md-select'); + it('should be multiple if attr.multiple exists', function() { + var el = setupSelect('multiple ng-model="$root.model"').find('md-select'); + openSelect(el); + expectSelectOpen(el); + + var selectMenu = $document.find('md-select-menu')[0]; + + expect(selectMenu.hasAttribute('multiple')).toBe(true); + }); + + it('should not be multiple if attr.multiple does not exist', function() { + var el = setupSelect('ng-model="$root.model"').find('md-select'); openSelect(el); expectSelectOpen(el); @@ -1207,7 +1217,7 @@ describe('', function() { $rootScope.model = 2; $rootScope.opts = [1, 2, 3, 4]; var form = $compile('
' + - '' + + '' + '{{opt}}' + '')($rootScope); var el = form.find('md-select');