O'Reilly logo

Ember.js Cookbook by Erik Hanchett

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

Using Ember validations

Data form validation is a very common use case in web development. The end user will know immediately if they've made a mistake when you create validation rules in your application.

In this recipe, we'll take a look at two examples on validation. In the first example, we'll use a component and check data based on a few simple validation rules. In the second example, we'll use a popular Ember add-on to make things easier.

How to do it...

  1. In a new application, create two components and install the validation add-on:
    $ ember g component val-example
    $ ember g component val-example2
    $ ember install ember-cp-validations
    

    The val-example component will be the first example. The val-example2 component will be the second example using ...

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