O'Reilly logo

Mastering Ember.js by Mitchel Kelonye

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Extending templates

In the course of application development, you might find the need to abstract templates for reuse. There are several helpers that can help us implement this easily:

  • partial
  • view
  • render
  • named outlets

The partial helper is used to include templates inside others. It simply inserts the desired template where the partial expression has been specified. As discussed earlier, the chapter sample used this helper in two instances:

  <script
   type="text/x-handlebars"
  data-template-name="contact/edit">
    {{#with controller.controllers.contact}}
    {{partial "contacts/form"}}
    {{/with}}
  </script>

 <script
   type="text/x-handlebars"
  data-template-name="contacts/new">
    {{partial "contacts/form"}}

  </script>

This helper takes the template that should be inserted ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required