ons-template

Define a separate HTML fragment and use as a template. These templates can be loaded as pages in <ons-navigator>, <ons-tabbar> and <ons-splitter>. They can also be used to generate dialogs. Since Onsen UI 2.4.0, the native <template> element can be used instead of <ons-template> for better performance and features. <ons-template> is still supported for backward compatibility.

Usage


<ons-template id="foobar.html">
  <ons-page>
    Page content
  </ons-page>
</ons-template>
<ons-navigator page="foobar.html"></ons-navigator>

See also

Properties

Name Description
template Template content. This property can not be used with AngularJS bindings.

Discussion

Need Help?

If you have any questions, use our Community Forum or talk to us via Gitter chat. The Onsen UI team and your peers in the community will work together to help solve your issues.

For bug reports and feature requests use our GitHub Issues page.