Feature Flags

Feature Flags New features are added to Ember.js within conditional statements. Code behind these flags can be conditionally enabled (or completely removed) based on your project's configuration. This allows newly developed features to be selectively released when the Ember.js community considers them ready for production use. Feature Life-Cycle A newly-flagged feature is only available in canary builds and can be enabled at runtime through your project's configuration file. At the start of a

DS.Ember.HTMLBars.helpers

DS.Ember.HTMLBars.helpers Class Module: ember-data

Handling Events

Handling Events You can respond to user events on your component like double-clicking, hovering, and key presses through event handlers. Simply implement the name of the event you want to respond to as a method on your component. For example, imagine we have a template like this: {{#double-clickable}} This is a double clickable area! {{/double-clickable}} Let's implement double-clickable such that when it is clicked, an alert is displayed: app/components/double-clickable.js import Ember fr

Ember.computed.map()

map (dependentKey, callback) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/reduce_computed_macros.js:168 Returns an array mapped via the callback The callback method you provide should have the following signature. item is the current item in the iteration. index is the integer index of the current item in the iteration. function(item, index); Example let Hamster = Ember.Object.extend({ excitingChores: Ember.computed.map('chores', function(chore, index) {

Loading / Error Substates

Loading / Error Substates The Ember Router allows you to provide feedback that a route is loading, as well as when an error occurs in loading a route. loading substates During the beforeModel, model, and afterModel hooks, data may take some time to load. Technically, the router pauses the transition until the promises returned from each hook fulfill. Consider the following: app/router.js Router.map(function() { this.route('slow-model'); }); app/routes/slow-model.js import Ember from 'embe

DefaultResolver#resolveHelper()

resolveHelper (parsedName) protected Defined in packages/ember-application/lib/system/resolver.js:367 Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application) Parameters: parsedName Object a parseName object with the parsed fullName lookup string

Ember.GUID_KEY

GUID_KEYStringprivateconstant Defined in packages/ember-metal/lib/utils.js:94 A unique key used to assign guids and other private metadata to objects. If you inspect an object in your browser debugger you will often see these. They can be safely ignored. On browsers that support it, these properties are added with enumeration disabled so they won't show up when you iterate over your properties.

Ember.run.begin()

beginVoidpublic Defined in packages/ember-metal/lib/run_loop.js:180 Begins a new RunLoop. Any deferred actions invoked after the begin will be buffered until you invoke a matching call to run.end(). This is a lower-level way to use a RunLoop instead of using run(). run.begin(); // code to be executed within a RunLoop run.end(); Returns: Void

Testing Components

Testing Components Components can be tested with integration tests using the moduleForComponent helper. Let's assume we have a component with a style property that is updated whenever the value of the name property changes. The style attribute of the component is bound to its style property. You can follow along by generating your own component with ember generate component pretty-color. app/components/pretty-color.js import Ember from 'ember'; export default Ember.Component.extend({ att

DS.SnapshotRecordArray#meta

meta{Object} Defined in addon/-private/system/snapshot-record-array.js:40 Meta object