Javascript 将数据推送到余烬对象中

Javascript 将数据推送到余烬对象中,javascript,ember.js,ember-data,Javascript,Ember.js,Ember Data,我的余烬应用程序中有上述两个模型。我对路线的定义如下 App.Friend = DS.Model.extend({ fid: DS.attr("Number"), name: DS.attr("String"), bills: DS.hasMany("bill", {async: true}) }); App.Bill = DS.Model.extend({ description: DS.attr("String"), amount: DS.

我的余烬应用程序中有上述两个模型。我对路线的定义如下

App.Friend = DS.Model.extend({
     fid: DS.attr("Number"),
     name: DS.attr("String"),
     bills: DS.hasMany("bill", {async: true})
});

App.Bill = DS.Model.extend({
     description: DS.attr("String"),
     amount: DS.attr("Number"),
     date: DS.attr("Date"),
     friend: DS.belongsTo("friend")
});
当我在“朋友详细信息”视图中时,我需要向特定朋友添加账单。但我无法在FriendController中控制该特定模型

 App.Router.map(function(){
     this.resource("friends", function(){
          this.resource("friend", {path: ":id"});
     });
 });

在这种情况下,我如何将账单添加到特定的朋友?如果我没有看到路由,是否正在提取模型

App.FriendController = Ember.ObjectController.extend({
  actions: {
    addBill: function() {
        debugger;
    }
  }
});

谢谢@kingpin2k。我被这个.get(“model”)返回的承诺弄糊涂了。
App.FriendController = Ember.ObjectController.extend({
  actions: {
    addBill: function() {
      var model = this.get('model');
      model.get('bills').then(function(bills){
        bills.pushObject(.....); //Push it here
      });
    }
  }
});