我有以下路由器:
this.resource('foo', {path: '/foo'}, function() {
this.resource('foo.bar', {path: '/bar'}, function() {
this.route('wat', {path: '/wat'});
});
});
我FooBarWatController
是一个单身人士,我需要访问FooBarController
的模型。可以访问的needs
外观是什么样FooBarWatController
的FooBarController
?
FooBarWatContoller = Ember.ObjectController.extend({
needs: ['?'],
action: {
something: function() {
console.log(this.get('controllers.?.model').get('id'));
}
}
});
FooBarWatContoller = Ember.ObjectController.extend({
needs: ['foo/bar'],
action: {
something: function() {
console.log(this.get('controllers.foo/bar.model').get('id'));
}
}
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句