0

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 ?

1
  • it is md-select not m-select just saying! Commented May 30, 2017 at 12:41

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.