Skip to content

Instantly share code, notes, and snippets.

@Sweet-Bob
Sweet-Bob / application.js
Created August 15, 2016 11:08 — forked from greyby/application.js
custom ember data's restful URL and modify the HTTP method
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
// namespace: 'api/v2',
host: 'http://localhost:8080',
find: function(store, type, id, snapshot) {
return this.ajax(this.buildURL(type.typeKey, id, snapshot, 'find'), 'GET');
},
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { run } from '@ember/runloop';
const { stringify } = JSON;
export default class ApplicationController extends Controller {
maxId = 6;
@tracked