Reputation: 8189
Typically, Ember automatically puts the route's model in scope when rendering a handlebars template:
<h1>{{ title }}</h1>
Renders:
<h1>My Title</h1>
For some reason, it's not doing that for me with a particular route. I'm just getting an empty <h1></h1>
. However, if I manually put it into scope:
<h1>{{ model.title }}</h1>
Then it works as expected. What might be causing this behavior? My route is basic:
MeetingsShowRoute = Ember.Route.extend
model: (params) ->
@store.find('meeting', params.id)
`export default MeetingsShowRoute`
And both the relevant view and controller is empty.
Upvotes: 3
Views: 149
Reputation: 47367
Your controller is probably extending the controller class, when it should be extending object controller.
MeetingsShowController = Ember.ObjectController.extend ...
Rule of thumb:
FooControler = Ember.Controller.extend
FooControler = Ember.ObjectController.extend
FooControler = Ember.ArrayController.extend
Upvotes: 2