This repository was archived by the owner on Sep 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
src/components/autocomplete Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1061,6 +1061,25 @@ describe('<md-autocomplete>', function() {
1061
1061
expect ( ctrl . isRequired ) . toBe ( true ) ;
1062
1062
} ) ;
1063
1063
1064
+ it ( 'should forward the md-no-asterisk attribute' , function ( ) {
1065
+ var scope = createScope ( ) ;
1066
+ var template = '\
1067
+ <md-autocomplete\
1068
+ md-selected-item="selectedItem"\
1069
+ md-search-text="searchText"\
1070
+ md-items="item in match(searchText)"\
1071
+ md-item-text="item.display"\
1072
+ md-min-length="0" \
1073
+ required\
1074
+ md-no-asterisk="true"\
1075
+ md-floating-label="Asterisk Label">\
1076
+ <span md-highlight-text="searchText">{{item.display}}</span>\
1077
+ </md-autocomplete>' ;
1078
+ var element = compile ( template , scope ) ;
1079
+ var input = element . find ( 'input' ) ;
1080
+
1081
+ expect ( input . attr ( 'md-no-asterisk' ) ) . toBe ( 'true' ) ;
1082
+ } ) ;
1064
1083
} ) ;
1065
1084
1066
1085
describe ( 'md-highlight-text' , function ( ) {
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ angular
52
52
* @param {boolean= } md-autofocus If true, the autocomplete will be automatically focused when a `$mdDialog`,
53
53
* `$mdBottomsheet` or `$mdSidenav`, which contains the autocomplete, is opening. <br/><br/>
54
54
* Also the autocomplete will immediately focus the input element.
55
+ * @param {boolean= } md-no-asterisk When present, asterisk will not be appended to the floating label
55
56
* @param {boolean= } md-autoselect If true, the first item will be selected by default
56
57
* @param {string= } md-menu-class This will be applied to the dropdown menu for styling
57
58
* @param {string= } md-floating-label This will add a floating label to autocomplete and wrap it in
@@ -244,6 +245,7 @@ function MdAutocomplete () {
244
245
ng-model="$mdAutocompleteCtrl.scope.searchText"\
245
246
ng-keydown="$mdAutocompleteCtrl.keydown($event)"\
246
247
ng-blur="$mdAutocompleteCtrl.blur()"\
248
+ ' + ( attr . mdNoAsterisk != null ? 'md-no-asterisk="' + attr . mdNoAsterisk + '"' : '' ) + '\
247
249
ng-focus="$mdAutocompleteCtrl.focus()"\
248
250
aria-owns="ul-{{$mdAutocompleteCtrl.id}}"\
249
251
' + ( attr . mdSelectOnFocus != null ? 'md-select-on-focus=""' : '' ) + '\
You can’t perform that action at this time.
0 commit comments