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

ember-htmlbars

ember-htmlbars Module Parent: ember HTMLBars is a Handlebars compatible templating engine used by Ember.js. The classes and namespaces covered by this documentation attempt to focus on APIs for interacting with HTMLBars itself. For more general guidance on Ember.js templates and helpers, please see the ember-templates package.

DS.Store#modelFor()

modelFor (modelName) DS.Model Defined in addon/-private/system/store.js:1921 Returns the model class for the particular modelName. The class of a model might be useful if you want to get a list of all the relationship names of the model, see relationshipNames for example. Parameters: modelName String Returns: DS.Model

Enumerable#contains()

contains (obj) Booleandeprecatedpublic Defined in packages/ember-runtime/lib/mixins/enumerable.js:217 Use Enumerable#includes instead. See http://emberjs.com/deprecations/v2.x#toc_enumerable-contains Returns true if the passed object can be found in the receiver. The default version will iterate through the enumerable until the object is found. You may want to override this with a more efficient version. let arr = ['a', 'b', 'c']; arr.contains('a'); // true arr.contains('z'); // false

DS.JSONSerializer#extractAttributes()

extractAttributes (modelClass, resourceHash) Object Defined in addon/serializers/json.js:564 Returns the resource's attributes formatted as a JSON-API "attributes object". http://jsonapi.org/format/#document-resource-object-attributes Parameters: modelClass Object resourceHash Object Returns: Object

DS.Model.typeForRelationship()

typeForRelationship (name, store) DS.Modelstatic Defined in addon/-private/system/relationships/ext.js:161 For a given relationship name, returns the model type of the relationship. For example, if you define a model like this: app/models/post.js import DS from 'ember-data'; export default DS.Model.extend({ comments: DS.hasMany('comment') }); Calling App.Post.typeForRelationship('comments') will return App.Comment. Parameters: name String the name of the relationship store Store

DS.RESTSerializer#normalize()

normalize (modelClass, resourceHash, prop) Object Inherited from DS.JSONSerializer but overwritten in addon/serializers/rest.js:91 Normalizes a part of the JSON payload returned by the server. You should override this method, munge the hash and call super if you have generic normalization to do. It takes the type of the record that is being normalized (as a DS.Model class), the property where the hash was originally found, and the hash to normalize. For example, if you have a payload that l

DS.RESTSerializer#pushPayload()

pushPayload (store, payload) Defined in addon/serializers/rest.js:380 This method allows you to push a payload containing top-level collections of records organized per type. { "posts": [{ "id": "1", "title": "Rails is omakase", "author", "1", "comments": [ "1" ] }], "comments": [{ "id": "1", "body": "FIRST" }], "users": [{ "id": "1", "name": "@d2h" }] } It will first normalize the payload, so you can use this to push in data streaming in from y

DS.Model.relationshipsByName

relationshipsByNameEmber.Mapstatic Defined in addon/-private/system/relationships/ext.js:450 A map whose keys are the relationships of a model and whose values are relationship descriptors. For example, given a model with this definition: app/models/blog.js import DS from 'ember-data'; export default DS.Model.extend({ users: DS.hasMany('user'), owner: DS.belongsTo('user'), posts: DS.hasMany('post') }); This property would contain the following: import Ember from 'ember'; import Blo

ViewTargetActionSupport#append()

appendEmber.Viewprivate Defined in packages/ember-views/lib/mixins/view_support.js:229 Appends the view's element to the document body. If the view does not have an HTML representation yet the element will be generated automatically. If your application uses the rootElement property, you must append the view within that element. Rendering views outside of the rootElement is not supported. Note that this method just schedules the view to be appended; the DOM element will not be appended to t