Model复数变体的处理

2017-11-07  本文已影响35人  81fe5084e6c1
import DS from 'ember-data';
import Ember from 'ember';

export default DS.JSONAPIAdapter.extend({
  //host: 'http://mform.cn',
  host: 'http://localhost:3000',
  namespace: 'api/v1',
  pathForType: function(modelName) {
    //return Ember.String.underscore(type) + 's';
    let decamelized = Ember.String.decamelize(modelName)
    return Ember.String.pluralize(decamelized)
  }
});
上一篇 下一篇

猜你喜欢

热点阅读