WHAT IS THE DIFFERENCE BETWEEN REQUIRED AND NG-REQUIRED?

What is the difference between required and ng-required?

In HTML attribute required is to tell that field must be required in order for the form to be valid.

And it is not possible to write condition like required=”true” or required=”false”. It gives you a HTML error. This can be solved using Angular.

While, Using Angular attribute ng-required=”MyCondition” means ‘RequireFun(MyCondition)’ and sets the HTML attribute dynamically for you depending on your condition.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>