typeForRelationship (name, store) DS.Modelstatic
For a given relationship name, returns the model type of the relationship.
For example, if you define a model like this:
app/models/post.jsimport 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 - an instance of DS.Store
Returns:
-
DS.Model - the type of the relationship, or undefined
Please login to continue.