I have this HTML/Handlebars code, what I would like is for the "outlet fav" to render the template with id "fav" and its corresponding outlet/templates-chain with expected "index". Kinda like displaying a different Ember URL as a part of the index. Is it possible natively(Without supplementing an iframe, which I think is a bad idea)? would it be considered a good practice(I know using views might help but just wondering if it is ok to walk this road)?
<script type="text/x-handlebars" id="application">
Here we have our application
{{outlet}}
</script>
<script type="text/x-handlebars" id="index">
Application's First Child
{{outlet}}
</script>
<script type="text/x-handlebars" id="index/index">
Your Favourites
{{outlet fav}}
</script>
<script type="text/x-handlebars" id="fav">
{{#link-to 'fav'}}All{{/link-to}} <!-- Link A-->
{{#link-to 'fav.top'}}Top{{/link-to}} <!-- Link B-->
<!-- Expected Output from "fav/index" -->
{{outlet}}
</script>
<script type="text/x-handlebars" id="fav/index">
All Favourites Content
</script>
<script type="text/x-handlebars" id="fav/top">
Top Favourites Content
</script>
<script type="text/x-handlebars" id="football">
Football Content
</script>
JS Code: Here's what I tried
App.Router.map(function(){
this.resource('index', {path: '/'}, function(){
this.resource('fav', function(){
this.route('top');
this.route('last');
});
});
this.route('football');
});
App.IndexIndexRoute = Ember.Route.extend({
renderTemplate: function() {
this.render();
this.render("fav", {into: 'index'});
}
});
Output: =================================== Here we have our application Application's First Child Your Favourites Link A Link B =================================== Omits the child outlet which should display content from "fav/index" Help Appreciated.
You can add an additional render call in IndexIndexRoute,
http://jsfiddle.net/7b8HT/
Also, you may certainly use views as well to achieve similar results.