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

Commit ef97faf

Browse files
Splaktarjosephperrott
authored andcommitted
docs(input,input-container): fix type syntax. add docs for md-select (#11434)
1 parent aa30ada commit ef97faf

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

src/components/input/input.js

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,31 @@ if (window._mdMocksIncluded) {
4545
* @restrict E
4646
*
4747
* @description
48-
* `<md-input-container>` is the parent of any input or textarea element.
48+
* `<md-input-container>` is the parent of any input or textarea element. It can also optionally
49+
* wrap `<md-select>` elements so that they will be formatted for use in a form.
4950
*
50-
* Input and textarea elements will not behave properly unless the md-input-container
51-
* parent is provided.
51+
* Input and textarea elements will not behave properly unless the md-input-container parent is
52+
* provided.
5253
*
53-
* A single `<md-input-container>` should contain only one `<input>` element, otherwise it will throw an error.
54+
* A single `<md-input-container>` should contain only one `<input>` or `<md-select>` element,
55+
* otherwise it will throw an error.
5456
*
55-
* <b>Exception:</b> Hidden inputs (`<input type="hidden" />`) are ignored and will not throw an error, so
56-
* you may combine these with other inputs.
57+
* <b>Exception:</b> Hidden inputs (`<input type="hidden" />`) are ignored and will not throw an
58+
* error, so you may combine these with other inputs.
5759
*
58-
* <b>Note:</b> When using `ngMessages` with your input element, make sure the message and container elements
59-
* are *block* elements, otherwise animations applied to the messages will not look as intended. Either use a `div` and
60-
* apply the `ng-message` and `ng-messages` classes respectively, or use the `md-block` class on your element.
60+
* <b>Note:</b> When using `ngMessages` with your input element, make sure the message and container
61+
* elements are *block* elements, otherwise animations applied to the messages will not look as
62+
* intended. Either use a `div` and apply the `ng-message` and `ng-messages` classes respectively,
63+
* or use the `md-block` class on your element.
6164
*
62-
* @param md-is-error {expression=} When the given expression evaluates to true, the input container
63-
* will go into error state. Defaults to erroring if the input has been touched and is invalid.
64-
* @param md-no-float {boolean=} When present, `placeholder` attributes on the input will not be converted to floating
65-
* labels.
65+
* @param {expression=} md-is-error When the given expression evaluates to `true`, the input
66+
* container will go into the error state. Defaults to erroring if the input has been touched and
67+
* is invalid.
68+
* @param {boolean=} md-no-float When present, `placeholder` attributes on the input will not be
69+
* converted to floating labels.
6670
*
6771
* @usage
6872
* <hljs lang="html">
69-
*
7073
* <md-input-container>
7174
* <label>Username</label>
7275
* <input type="text" ng-model="user.name">
@@ -77,6 +80,11 @@ if (window._mdMocksIncluded) {
7780
* <textarea ng-model="user.description"></textarea>
7881
* </md-input-container>
7982
*
83+
* <md-input-container>
84+
* <md-select ng-model="user.state" placeholder="State of Residence">
85+
* <md-option ng-value="state" ng-repeat="state in states">{{ state }}</md-option>
86+
* </md-select>
87+
* </md-input-container>
8088
* </hljs>
8189
*
8290
* <h3>When disabling floating labels</h3>
@@ -85,7 +93,6 @@ if (window._mdMocksIncluded) {
8593
* <md-input-container md-no-float>
8694
* <input type="text" placeholder="Non-Floating Label">
8795
* </md-input-container>
88-
*
8996
* </hljs>
9097
*/
9198
function mdInputContainerDirective($mdTheming, $parse) {
@@ -194,11 +201,12 @@ function labelDirective() {
194201
* will be logged in the console if not present.
195202
* @param {string=} placeholder An alternative approach to using aria-label when the label is not
196203
* PRESENT. The placeholder text is copied to the aria-label attribute.
197-
* @param md-no-autogrow {boolean=} When present, textareas will not grow automatically.
198-
* @param md-no-asterisk {boolean=} When present, an asterisk will not be appended to the inputs floating label
199-
* @param md-no-resize {boolean=} Disables the textarea resize handle.
204+
* @param {boolean=} md-no-autogrow When present, textareas will not grow automatically.
205+
* @param {boolean=} md-no-asterisk When present, an asterisk will not be appended to the inputs
206+
* floating label.
207+
* @param {boolean=} md-no-resize Disables the textarea resize handle.
200208
* @param {number=} max-rows The maximum amount of rows for a textarea.
201-
* @param md-detect-hidden {boolean=} When present, textareas will be sized properly when they are
209+
* @param {boolean=} md-detect-hidden When present, textareas will be sized properly when they are
202210
* revealed after being hidden. This is off by default for performance reasons because it
203211
* guarantees a reflow every digest cycle.
204212
*

0 commit comments

Comments
 (0)