Reputation: 3914
everyone.
I am developing app with angular and I am using Angular material for UI.
I know about angular validation
https://angular.io/docs/ts/latest/cookbook/form-validation.html
How can I validate md-select
?
Upvotes: 0
Views: 1841
Reputation: 13317
You can validate md-select the same way it's shown in the documentation. The main idea is to create a reference #someName
and the use that reference to do the validation. There are six controls that Angular provides: touched, untouched, dirty, pristine, valid and invalid.
I created a Plunker demo for you with the dirty
validation for md-select
.
You can read more about validation in the "Track control state and validity with ngModel" section, here: https://angular.io/docs/ts/latest/guide/forms.html
Upvotes: 2