Angular Forms

Objectives

  • Learn how to use the Angular directives for creating forms.
  • Know how Angular forms can be validated, client-side validation.

Demo

All code will be included in the index.html.

(Not great, but will get us through these simple demo files.)

The below is a recap of this article, Angular JS Forms.

Work thru these files in order. (See the *_done.html for finished versions)

  • simple_input_form.html
  • simple_checkbox_form.html
  • simple_radio_form.html
  • simple_select_form.html
  • complex_select_form.html
  • complex_select2_form.html
  • length_valid_form.html
  • regexp_valid_form.html
  • required_valid_form.html
  • field_state_form.html

Lab

Refactor the field_state_form to seperate the controller, view and css.

Lab

Back End

Create a backend Rails API using the rails-api gem. It should return a set of people where each person has a first/last name, age, agreement status, newletter subscription status and car make the person is interested in.

Front End

Show a list or table of all these people in the angular client side code.

Create new people using the form we worked on above. (Add client and server side validations)

Documentation

Angular JS Forms

AngularJS

API Documentation

This is like the $.ajax in JQuery.
Ajax HTTP Service