Ember 2 Session Two

Ember 2 Session Two


Ember Promise

Ember.RSVP.Promise

Common usage

let promise = new Promise(function(resolve, reject) {
  // on success
  resolve(value);

  // on failure
  reject(reason);
});

promise.then(function(value) {
  // on fulfillment
}, function(reason) {
  // on rejection
});

// alternatively ...then ... catch

Aside - Promise rejection handling

Other Promise Methods in Ember

- Promise.all
- Promise.resolve
- Promise.reject

Ember’s function and object polyfills

For example, deep copy

Routing

ember generate route

Ember routes

.transitionTo

Templates