How are validations implemented in AngularJS?
How are validations implemented in AngularJS?
One of the coolest features of AngularJS is client-side validation. There are so many form directives available in AngularJS. We will talk about some of them here, we will also explain custom validation. Using it you can create your own validations.
Initial requirement is reference,
Data type validation
a.In Html control use type field to specify the type of file.
b..$error.{your data type} will help you to disply the message.
Student Roll Number is required. Not valid number!
Required filed validation a. Put attribute as required in HTML control. b..$error.required helps you to display the required field message.Student Name is required.
Date Validation a. Specify the type as date and b. Format it will take as systems built-in format c. .$error.date helps you to display the required field message.
Student Birth Date:
Student Birth Date is required.
Not a Valid Date.
Comments
Post a Comment