I want to create a dashboard like UI. For this reason I want to render multiple templates with their individual model on one page.
I thought, I can solve this with the {{render}} helper (see http://emberjs.com/guides/templates/rendering-with-helpers/#toc_the-code-render-code-helper)
I've got the templates rendered but without data in it. You can see a minimal example of the problem on JsBin: http://jsbin.com/vasezutoxege/2/edit?html,css,js,output
Some snippets of the JsBin that direct related to the problem here:
App.Router.map(function() {
this.resource('contacts', function() {
this.resource('contact', { path: ':contact_id'});
});
this.resource('records', function() {
this.resource('record', { path: ':record_id'});
});
});
For every Router I have a model and a template. Then I want to show the routes in the index route of my application:
<script type="text/x-handlebars" data-template-name="index">
<!-- link to contacts route is showing contacts template with model right -->
{{#link-to "contacts"}}Link to contacts route{{/link-to}}
<!-- this loads the template but without data -->
<div class="template">
{{render "contacts" contacts}}
</div>
...
</script>
What can I do to render the complete templates together with their model-data in the outlet?
Thank you for your time!