this.controllerFor()不是一个函数

时间:2022-09-09 21:11:17

In one of the views in my ember 1.10.1 app, while am trying to get controller for that particular view am getting error "this.controllerFor()" is not a function. My view's code is something like,

在我的ember 1.10.1应用程序中的一个视图中,当我试图获取该特定视图的控制器时出现错误“this.controllerFor()”不是一个函数。我的观点代码是这样的,

didInsertElement: function () {
               var self = this,
               controller = self.controllerFor('favorites'); 
               ---some code---
}

1 个解决方案

#1


1  

Ember.View doesnt have a controllerFor method.

Ember.View没有controllerFor方法。

#1


1  

Ember.View doesnt have a controllerFor method.

Ember.View没有controllerFor方法。