Tutorialsplane

Angular Material Input


Angular Material Input: Angular Material provides md-input-container directory which allows us to create form data. You can add validation and display error messages using for input fields. Here in this tutorial we are going to explain how you can create form elements using this directory. You can also use our online editor to edit and run the code online.


Angular Material Input Example

Let us first create a very basic example-

Form Validation With Error Messages

Here is a simple form with validation and error messages –

Angular Material Input | Form Validation With Error Messages Example:



Try It On →

If you run the above example it will produce output something like this –

ng-message – displays the error message when the validation is failed and it automatically hides error message when the input field has valid data.

Attributes

Following Attributes are available –

Learn Angular Material