@@ -157,8 +157,7 @@ angular.module('material.components.select', [
157157 * </div>
158158 * </hljs>
159159 */
160- function SelectDirective ( $mdSelect , $mdUtil , $mdConstant , $mdTheming , $mdAria , $parse , $sce ,
161- $injector ) {
160+ function SelectDirective ( $mdSelect , $mdUtil , $mdConstant , $mdTheming , $mdAria , $parse , $sce ) {
162161 return {
163162 restrict : 'E' ,
164163 require : [ '^?mdInputContainer' , 'mdSelect' , 'ngModel' , '?^form' ] ,
@@ -167,6 +166,11 @@ function SelectDirective($mdSelect, $mdUtil, $mdConstant, $mdTheming, $mdAria, $
167166 } // empty placeholder controller to be initialized in link
168167 } ;
169168
169+ /**
170+ * @param {JQLite } tElement
171+ * @param {IAttributes } tAttrs
172+ * @return {postLink }
173+ */
170174 function compile ( tElement , tAttrs ) {
171175 var isMultiple = $mdUtil . parseAttributeBoolean ( tAttrs . multiple ) ;
172176 // add the select value that will hold our placeholder or selected option value
@@ -271,7 +275,7 @@ function SelectDirective($mdSelect, $mdUtil, $mdConstant, $mdTheming, $mdAria, $
271275 var selectValueElement = element . find ( 'md-select-value' ) ;
272276 var isReadonly = angular . isDefined ( attrs . readonly ) ;
273277 var disableAsterisk = $mdUtil . parseAttributeBoolean ( attrs . mdNoAsterisk ) ;
274- var stopNgMultipleWatch ;
278+ var stopMdMultipleWatch ;
275279 var userDefinedLabelledby = angular . isDefined ( attrs . ariaLabelledby ) ;
276280 var listboxContentElement = element . find ( 'md-content' ) ;
277281
@@ -390,7 +394,7 @@ function SelectDirective($mdSelect, $mdUtil, $mdConstant, $mdTheming, $mdAria, $
390394 } else {
391395 selectValueElement . removeAttr ( 'aria-hidden' ) ;
392396 if ( ! userDefinedLabelledby ) {
393- element . attr ( 'aria-labelledby' , element [ 0 ] . id + ' ' + selectValueElement [ 0 ] . id )
397+ element . attr ( 'aria-labelledby' , element [ 0 ] . id + ' ' + selectValueElement [ 0 ] . id ) ;
394398 }
395399 }
396400 } ;
@@ -428,7 +432,7 @@ function SelectDirective($mdSelect, $mdUtil, $mdConstant, $mdTheming, $mdAria, $
428432 containerCtrl && containerCtrl . setFocused ( false ) ;
429433 inputCheckValue ( ) ;
430434 } ;
431- var handleFocus = function ( ev ) {
435+ var handleFocus = function ( ) {
432436 // Always focus the container (if we have one) so floating labels and other styles are
433437 // applied properly
434438 containerCtrl && containerCtrl . setFocused ( true ) ;
@@ -465,15 +469,14 @@ function SelectDirective($mdSelect, $mdUtil, $mdConstant, $mdTheming, $mdAria, $
465469 mdSelectCtrl . setSelectValueText ( selectMenuCtrl . getSelectedLabels ( ) ) ;
466470 }
467471
468- // TODO add tests for ngMultiple
469- // TODO add docs for ngMultiple
470- // TODO in 1.2.0 rename this to mdMultiple
471- var stopNgMultipleObserver = attrs . $observe ( 'ngMultiple' , function ( val ) {
472- if ( stopNgMultipleWatch ) {
473- stopNgMultipleWatch ( ) ;
472+ // TODO add tests for mdMultiple
473+ // TODO add docs for mdMultiple
474+ var stopMdMultipleObserver = attrs . $observe ( 'mdMultiple' , function ( val ) {
475+ if ( stopMdMultipleWatch ) {
476+ stopMdMultipleWatch ( ) ;
474477 }
475478 var parser = $parse ( val ) ;
476- stopNgMultipleWatch = scope . $watch ( function ( ) {
479+ stopMdMultipleWatch = scope . $watch ( function ( ) {
477480 return parser ( scope ) ;
478481 } , function ( multiple , prevVal ) {
479482 var selectMenu = selectContainer . find ( 'md-select-menu' ) ;
@@ -561,8 +564,8 @@ function SelectDirective($mdSelect, $mdUtil, $mdConstant, $mdTheming, $mdAria, $
561564 scope . $on ( '$destroy' , function ( ) {
562565 stopRequiredObserver && stopRequiredObserver ( ) ;
563566 stopDisabledObserver && stopDisabledObserver ( ) ;
564- stopNgMultipleWatch && stopNgMultipleWatch ( ) ;
565- stopNgMultipleObserver && stopNgMultipleObserver ( ) ;
567+ stopMdMultipleWatch && stopMdMultipleWatch ( ) ;
568+ stopMdMultipleObserver && stopMdMultipleObserver ( ) ;
566569 stopSelectedLabelsWatcher && stopSelectedLabelsWatcher ( ) ;
567570 stopPlaceholderObserver && stopPlaceholderObserver ( ) ;
568571 stopInvalidWatch && stopInvalidWatch ( ) ;
@@ -1207,6 +1210,11 @@ function OptionDirective($mdButtonInkRipple, $mdUtil, $mdTheming) {
12071210 compile : compile
12081211 } ;
12091212
1213+ /**
1214+ * @param {JQLite } element
1215+ * @param {IAttributes } attrs
1216+ * @return {postLink }
1217+ */
12101218 function compile ( element , attrs ) {
12111219 // Manual transclusion to avoid the extra inner <span> that ng-transclude generates
12121220 element . append ( angular . element ( '<div class="md-text">' ) . append ( element . contents ( ) ) ) ;
@@ -1332,6 +1340,10 @@ function OptionDirective($mdButtonInkRipple, $mdUtil, $mdTheming) {
13321340 }
13331341}
13341342
1343+ /**
1344+ * @param {JQLite } $element
1345+ * @constructor
1346+ */
13351347function OptionController ( $element ) {
13361348 /**
13371349 * @param {boolean } isSelected
@@ -1757,7 +1769,6 @@ function SelectProvider($$interimElementProvider) {
17571769
17581770 var dropDown = opts . selectEl ;
17591771 var selectMenuController = dropDown . controller ( 'mdSelectMenu' ) || { } ;
1760- var listbox = opts . contentEl ;
17611772
17621773 element . addClass ( 'md-clickable' ) ;
17631774
0 commit comments