LinkComponent#disabled

disabledprivate Defined in packages/ember-htmlbars/lib/components/link-to.js:530 Accessed as a classname binding to apply the LinkComponent's disabledClass CSS class to the element when the link is disabled. When true interactions with the element will not trigger route changes.

RSVP.Promise#catch()

catch (onRejection, label) Promise Defined in bower_components/rsvp/lib/rsvp/promise.js:410 catch is simply sugar for then(undefined, onRejection) which makes it the same as the catch block of a try/catch statement. function findAuthor(){ throw new Error('couldn't find that author'); } // synchronous try { findAuthor(); } catch(reason) { // something went wrong } // async with promises findAuthor().catch(function(reason){ // something went wrong }); Parameters: onRejection Fun

DS.BuildURLMixin

DS.BuildURLMixin Class Defined in: addon/-private/adapters/build-url-mixin.js:5 Module: ember-data WARNING: This interface is likely to change in order to accomodate https://github.com/emberjs/rfcs/pull/4 Using BuildURLMixin To use url building, include the mixin when extending an adapter, and call buildURL where needed. The default behaviour is designed for RESTAdapter. Example export default DS.Adapter.extend(BuildURLMixin, { findRecord: function(store, type, id, snapshot) {

Defining Your Routes

Defining Your Routes When your application starts, the router matches the current URL to the routes that you've defined. The routes, in turn, are responsible for displaying templates, loading data, and setting up application state. To define a route, run ember generate route route-name This creates a route file at app/routes/route-name.js, a template for the route at app/templates/route-name.hbs, and a unit test file at tests/unit/routes/route-name-test.js. It also adds the route to the rout

Array#indexOf()

indexOf (object, startAt) Numberpublic Defined in packages/ember-runtime/lib/mixins/array.js:370 Returns the index of the given object's first occurrence. If no startAt argument is given, the starting location to search is 0. If it's negative, will count backward from the end of the array. Returns -1 if no match is found. let arr = ['a', 'b', 'c', 'd', 'a']; arr.indexOf('a'); // 0 arr.indexOf('z'); // -1 arr.indexOf('a', 2); // 4 arr.indexOf('a', -1); // 4 arr.indexOf('

DS.Snapshot#changedAttributes()

changedAttributesObject Defined in addon/-private/system/snapshot.js:135 Returns all changed attributes and their old and new values. Example // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' }); postModel.set('title', 'Ember.js rocks!'); postSnapshot.changedAttributes(); // => { title: ['Ember.js rocks', 'Ember.js rocks!'] } Returns: Object All changed attributes of the current snapshot

DS.SnapshotRecordArray#adapterOptions

adapterOptions{Object} Defined in addon/-private/system/snapshot-record-array.js:46 A hash of adapter options

DS.Errors#registerHandlers()

registerHandlers (target, becameInvalid, becameValid) deprecated Defined in addon/-private/system/model/errors.js:91 Register with target handler Parameters: target Object becameInvalid Function becameValid Function

Testing

Introduction Testing is a core part of the Ember framework and its development cycle. Let's assume you are writing an Ember application which will serve as a blog. This application would likely include models such as user and post. It would also include interactions such as login and create post. Let's finally assume that you would like to have automated tests in place for your application. There are three different classifications of tests that you will need: Acceptance, Unit, and Integratio

DS.RESTAdapter#isInvalid()

isInvalid (status, headers, payload) Boolean Defined in addon/adapters/rest.js:960 Available since 1.13.0 Default handleResponse implementation uses this hook to decide if the response is a an invalid error. Parameters: status Number headers Object payload Object Returns: Boolean