Angular Material - Angular Material Input - Angular Material Tutorial
What is Input in Angular Material?
- The md-input-container an Angular directive, is a container component to contains any <input> or <textarea> element as a child.
- md-input-container also supports error handling using the standard ng-messages directives and animates the messages using ngEnter/ngLeave events or the ngShow/ngHide events.
learn angular material tutorials - form design - input fields Example
Attributes:
Sr.No | Parameter & Description |
---|---|
1 | md-maxlength The maximum number of characters allowed in this input. If this is specified, a character counter will be shown underneath the input. The purpose of the md-maxlength is to show the max length counter text. If you don't want the counter text and only need "plain" validation, you can use the "simple" ng-maxlength or maxlength attributes. |
2 | aria-label Aria-label is required when no label is present. A warning message will be logged in the console if a label is not present. |
3 | placeholder An alternative approach to using aria-label when the label is not present. The placeholder text is copied to the aria-label attribute. |
4 | md-no-autogrow When present, the textareas will not grow automatically. |
5 | md-detect-hidden When present, the textareas will be sized properly when they are revealed after being hidden. This is off by default for performance reasons because it guarantees a reflow every digest cycle. |
Example:
- The following example showcases the use of md-input-container directive to showcase uses of inputs.