美文网首页
Model复数变体的处理

Model复数变体的处理

作者: 81fe5084e6c1 | 来源:发表于2017-11-07 23:32 被阅读35次
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)
  }
});

相关文章

网友评论

      本文标题:Model复数变体的处理

      本文链接:https://www.haomeiwen.com/subject/acismxtx.html