O'Reilly logo

Rails, Angular, Postgres, and Bootstrap, 2nd Edition by David B. Copeland

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

Marrying Angular’s and Bootstrap’s Form Validations

Bootstrap provides classes that, when applied to form elements, can indicate to the user that the data in that element is correct or incorrect. Angular provides features to describe the valid state of data in a form element as well as a way to check a field’s validity with code. We just need to connect Bootstrap’s styles with Angular’s form validations.

For our form, we’ll keep things simple. We’ll require that every field has a value, and we’ll additionally require that zip code fields look like zip codes. We may need more sophisticated validations in the future, but this will be enough to learn how they work.

Don’t make these changes to all the text fields just yet. We’re going to make ...

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