Service for making Fetch requests in Ember applications. Mimics the ember-ajax magic. The way it builts the URL, works with the headers, handles errors, and provides a useful service.
- customizable service
- returns RSVP promises
- improved error handling
- ability to specify request headers
ember install @prysmex-engineering/ember-fetch-request
To use the fetch service, inject the fetch-request
service into your route or component.
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default class AnyRoute extends Route {
@service fetchRequest;
model() {
return this.fetchRequest.request('/posts');
}
}
//TODO: Translate ajax to fetch and update