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

Commit cef9c44

Browse files
devversionThomasBurleson
authored andcommitted
docs(chips): add info about disabling autocomplete if maximum has reached.
* Adds a documentation about disabling the autocomplete, if the maximum amounts of chips has been reached. Closes #8332. Closes #8746
1 parent d04dfc5 commit cef9c44

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

src/components/chips/js/chipsDirective.js

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,31 @@
5656
* </ul>
5757
* </ul>
5858
*
59-
* <span style="font-size:.8em;text-align:center">
60-
* Warning: This component is a WORK IN PROGRESS. If you use it now,
61-
* it will probably break on you in the future.
62-
* </span>
59+
* <span style="font-size:.8em;text-align:center">
60+
* Warning: This component is a WORK IN PROGRESS. If you use it now,
61+
* it will probably break on you in the future.
62+
* </span>
63+
*
64+
* Sometimes developers want to limit the amount of possible chips.<br/>
65+
* You can specify the maximum amount of chips by using the following markup.
66+
*
67+
* <hljs lang="html">
68+
* <md-chips
69+
* ng-model="myItems"
70+
* placeholder="Add an item"
71+
* md-max-chips="5">
72+
* </md-chips>
73+
* </hljs>
74+
*
75+
* In some cases, you have an autocomplete inside of the `md-chips`.<br/>
76+
* When the maximum amount of chips has been reached, you can also disable the autocomplete selection.<br/>
77+
* Here is an example markup.
78+
*
79+
* <hljs lang="html">
80+
* <md-chips ng-model="myItems" md-max-chips="5">
81+
* <md-autocomplete ng-hide="myItems.length > 5" ...></md-autocomplete>
82+
* </md-chips>
83+
* </hljs>
6384
*
6485
* @param {string=|object=} ng-model A model to bind the list of items to
6586
* @param {string=} placeholder Placeholder text that will be forwarded to the input.

0 commit comments

Comments
 (0)