Class BuildURLMixin

public

Using BuildURLMixin

To use URL building, include the mixin when extending an adapter, and call buildURL where needed. The default behaviour is designed for RESTAdapter.

Example

1
2
3
4
5
6
7
8
import Adapter, { BuildURLMixin } from '@ember-data/adapter';

export default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {
  findRecord(store, type, id, snapshot) {
    var url = this.buildURL(type.modelName, id, snapshot, 'findRecord');
    return this.ajax(url, 'GET');
  }
}

Attributes

The host and namespace attributes will be used if defined, and are optional.