O'Reilly logo

Mastering Web Application Development with AngularJS by Pawel Kozlowski, Peter Bacon Darwin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding the input directives

In this section we describe the AngularJS input directives that are provided out of the box. Using input directives is very natural to people used to HTML forms because AngularJS builds on top of HTML.

You can use all the standard HTML input types in your forms. The input directives work with the ngModel directive to support additional functionality, such as validation or binding to the model. The AngularJS input directive checks the type attribute to identify what kind of functionality to add to the input element.

Adding the required validation

All the basic input directives support the use of the required (or ngRequired) attribute. Adding this attribute to your input element will tell AngularJS that the ngModel ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required