Suppose I have the following:
window.App = Ember.Application.create();
App.Router.map(function() {
this.resource("cars",function (){
this.route("new");
});
});
if I understand well, first, cars template will be rendered then cars/new template will be rendered into outlet of car’s template. But I don’t want this, i want to render cars/new template in a different template. I think it’s not always that we want to render a render a child template in it’s parent template. Because for e.g. /cars may show all cars and /cars/new may allow you to add a new car and you want to view all cars while adding a new car.
In fact, my question, suppose i want to render the car/new template in the following example in the main outlet in the application template, how can i achieve this:
<html>
<head>.....</head>
<body>
<script type="text/x-handlebars" data-template-name="cars">
cars<br/>
</script>
<script type="text/x-handlebars" data-template-name="cars/new">
cars new
</script>
<script type="text/x-handlebars">
<header id="header">
{{outlet header}}
</header>
<section id="main">
{{outlet main}}
</section>
<footer id="footer">
Some footer
</footer>
</script>
<!--lib files-->
<!--script will go here-->
</body>
</html>