Skip to content

portal() helper

Choose a tag to compare

@matthewp matthewp released this 17 Dec 18:38
· 154 commits to master since this release

This release introduces the portal helper. This is a helper that allows you to render HTML to somewhere else in the document.

For example, given this ViewModel:

const ViewModel = DefineMap.extend({
   head: {
     default: () => document.head
   }
});

You can now render to the document.head within the template:

{{# portal( head ) }}
  <title>Cart page</title>
  <meta og:title="Cart page">
{{ /portal }}

<p>Rest of the template here...</p>

For more information, check out the portal helper docs.