Route#renderTemplate()

renderTemplate (controller, model) public

Defined in packages/ember-routing/lib/system/route.js:1785

A hook you can use to render the template for the current route.

This method is called with the controller for the current route and the model supplied by the model hook. By default, it renders the route's template, configured with the controller for the route.

This method can be overridden to set up and render additional or alternative templates.

App.PostsRoute = Ember.Route.extend({
  renderTemplate: function(controller, model) {
    let favController = this.controllerFor('favoritePost');

    // Render the `favoritePost` template into
    // the outlet `posts`, and display the `favoritePost`
    // controller.
    this.render('favoritePost', {
      outlet: 'posts',
      controller: favController
    });
  }
});

Parameters:

controller Object
the route's controller
model Object
the route's model
doc_EmberJs
2016-11-30 16:53:11
Comments
Leave a Comment

Please login to continue.