Ember适配器动态路径使用pathForType

时间:2015-06-17 21:51:40

标签: ember.js ember-data

我正在扩展适配器:

import config from '../config/environment';
import Firebase from 'firebase';
import Ember from 'ember';
import ApplicationAdapter from './application';

export default ApplicationAdapter.extend({
  pathForType: function(type) {
    return "posts/" + this.get("session.auth.uid") + "/causeRecs";
  }
});

我希望适配器也能够使用要保存的记录的属性(record_A)动态设置pathForType:

return "posts/" + this.get("session.auth.uid") + "/causeRecs/" + this.get("record_A.path");

如何访问正在保存的记录的属性(record_A)?

0 个答案:

没有答案