3
votes

I am learning Ember and I have the following scenario... All views created using "outlets" properly get their controllers set by the framework. However I have a nested view embedded using {{view}} snippet. The view itself gets created but its controller doesn't get set. The view and controller share the proper naming convention and the framework should be able to associate them.

Why doesn't Ember associate controllers for views created with {{view}}? Looks like it does it for outlets only.

If this is by design then what is the reasoning behind it? What is the best practice to inject controllers for such views?

Thanks!

1

1 Answers

1
votes

Currently, the controller beeing set for this view is the controller of the parent view. For now you can perhaps manually set the controller you want with {{view App.YourView controllerBinding="App.yourViewController"}}.

That beeing said, you're right, Ember.js should probably do something neat buil-in. Maybe there is something scheduled for targetting this.