Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sub selection of multiple templates in one file #232

Open
stefanocudini opened this issue May 26, 2015 · 1 comment
Open

sub selection of multiple templates in one file #232

stefanocudini opened this issue May 26, 2015 · 1 comment

Comments

@stefanocudini
Copy link

Could be very useful to implement such as:
same file App/Template/One.html contains multiple templates

<script id="title1" type="text/x-handlebars-template">
<h1>{{title}}</h1>
</script>

<script id="title2" type="text/x-handlebars-template">
<h2>{{title}}</h2>
</script>

selection of sub elements

require([
  'hbs!App/Template/One#title1',
  'hbs!App/Template/One#title2'
], function ( tmpl1, tmpl2 ) {
  // Use whatever you would to render the template function
   $('body')
      .append( tmpl1({title: "Main Title"}) )
      .append( tmpl2({title: "Sub Title"}) );
});
@danielesalvatore
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants