HTML5 validation in Angular

by Admin 4. December 2014 00:05

Angular leverages HTML5 validation attributes and new HTML5 form elements. If we want Angular to handle validation we need to first stop HTML5 to do validation.
To do this specify “novalidate” attribute on the form tag.
<form name="frm1" novalidate>

So now the HTML will not fire any validations, instead it will be route to the Angular engine to take actions.
In other words when end user fills data in the HTML UI , validation events are routed to Angular framework, depending on scenario Angular sets a field called as “$Valid”. So if the validations are fine it sets it to “True” or else its sets it to “False”.


Comments are closed


Tag cloud