DS.BuildURLMixin#urlForFindHasMany()

urlForFindHasMany (id, modelName, snapshot) String

Defined in addon/-private/adapters/build-url-mixin.js:244

Builds a URL for fetching a async hasMany relationship when a url is not provided by the server.

Example:

app/adapters/application.js
import DS from 'ember-data';

export default DS.JSONAPIAdapter.extend({
  urlForFindHasMany(id, modelName, snapshot) {
    let baseUrl = this.buildURL(id, modelName);
    return `${baseUrl}/relationships`;
  }
});

Parameters:

id String
modelName String
snapshot DS.Snapshot

Returns:

String
url
doc_EmberJs
2016-11-30 16:49:30
Comments
Leave a Comment

Please login to continue.