O'Reilly logo

AngularJS Web Application Development Cookbook by Matt Frisbie

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

Working with AngularJS forms

AngularJS offers close integration with HTML form elements in the form of directives to afford you the ability to build animated and styled form pages, complete with validation, quickly and easily.

How to do it…

AngularJS forms exist inside the <form> tag, which corresponds to a native AngularJS directive, as shown in the following code. The novalidate attribute instructs the browser to ignore its native form validation:

<form novalidate>
  <!-- form inputs -->
</form>

Your HTML input elements will reside inside the <form> tags. Each instance of the <form> tag creates a FormController, which keeps track of all its controls and nested forms. The entire AngularJS form infrastructure is built on top of this.

Tip

As browsers don't ...

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