2013-07-24 199 views

回答

1

应用控制器:

App.ApplicationController = Ember.ObjectController.extend({ 

    findPersonById: function(id) { 
    ..... 
    .... 
    } 
}); 

下面是访问内部意见控制器应用程序控制器功能的方式。

评论控制器

App.CommentsController = Ember.ArrayController.extend({ 

    needs: ["application"], 

    getComments: function() { 

    var person = this.get("controllers.application").findPersonById(id); 
    .... 
    .... 
    } 

}); 
相关问题