mardi 25 août 2015

Accessing Model Data in Template

I have a route defined like so:

Router.map(function() {
    this.route('games', function() {
        this.route('game', {path: '/:game_id'}, function() {});
    });
});

When I visit path /games/1 I have to access the model data like so:

{{model.title}}

Reading the documentation, it seems that the controller would make the model data available without the model prefix so I thought I'd be able to do this:

{{title}}

But it doesn't work without model. I'm not creating the controller because I don't need to extend it for this particular route/template. Is accessing the model data via the model prefix accurate? Or am I possibly doing something else wrong?




Aucun commentaire:

Enregistrer un commentaire