Core Concepts

Core Concepts Before you start writing any Ember code, it's a good idea to get an overview of how an Ember application works. Router and Route Handlers Imagine we are writing a web app for a site that lets users list their properties to rent. At any given time, we should be able to answer questions about the current state like What rental are they looking at? and Are they editing it? In Ember, the answer to these questions is determined by the URL. The URL can be set in a few ways: The user

ApplicationInstance#customEvents

customEventsObjectprivate Defined in packages/ember-application/lib/system/application-instance.js:54 The DOM events for which the event dispatcher should listen. By default, the application's Ember.EventDispatcher listens for a set of standard DOM events, such as mousedown and keyup, and delegates them to your application's Ember.View instances.

Router#url()

urlStringprivate Defined in packages/ember-routing/lib/system/router.js:158 Represents the current URL. Returns: String The current URL.

DS.Store#findBelongsTo()

findBelongsTo (owner, link, relationship) Promiseprivate Defined in addon/-private/system/store.js:1059 Parameters: owner DS.Model link Any relationship Relationship Returns: Promise promise

Testing Controllers

Testing Controllers Unit testing methods and computed properties follows previous patterns shown in Unit Testing Basics because Ember.Controller extends Ember.Object. Unit testing controllers is very simple using the unit test helper which is part of the ember-qunit framework. Testing Controller Actions Here we have a controller PostsController with two properties, a method that sets one of those properties, and an action named setProps. You can follow along by generating your own controller

DS.JSONAPISerializer#payloadKeyFromModelName()

payloadKeyFromModelName (modelName) String Defined in addon/serializers/json-api.js:360 Parameters: modelName String Returns: String

DS.Store#dataWasUpdated()

dataWasUpdated (type, internalModel) private Defined in addon/-private/system/store.js:1666 If the adapter updates attributes the record will notify the store to update its membership in any filters. To avoid thrashing, this method is invoked only once per run loop per record. Parameters: type Class internalModel InternalModel

DS.Errors#content

content{Array}private Defined in addon/-private/system/model/errors.js:175

DS.JSONAPISerializer#serializeBelongsTo()

serializeBelongsTo (snapshot, json, relationship) Inherited from DS.JSONSerializer but overwritten in addon/serializers/json-api.js:516 Parameters: snapshot DS.Snapshot json Object relationship Object

DS.Store#adapterFor()

adapterFor (modelName) public Defined in addon/-private/system/store.js:2369 Returns an instance of the adapter for a given type. For example, adapterFor('person') will return an instance of App.PersonAdapter. If no App.PersonAdapter is found, this method will look for an App.ApplicationAdapter (the default adapter for your entire application). If no App.ApplicationAdapter is found, it will return the value of the defaultAdapter. Parameters: modelName String Returns: DS.Adapter