Nested route in emberjs without using a resource

I have a router with appropriate patterns for each route (and route objects). I want to be able to display each template regardless of its parent, that is, I do not want nested routes displayed in the parent template. Essentially make a separate "page" for each nested route.

App.Router.map(function() {
  this.resource('recipes', function() {
    this.route('new');
    this.route('show', { path: '/:recipe_id' });
  });
});

I am using ember1.0.0-rc1

thank

+5
source share
3 answers

I want to be able to display each template regardless of its parent, that is, I do not want nested routes displayed in the parent template.

, , , , . , recipes.hbs, ember new.hbs show.hbs {{outlet}} application.hbs.

. , Ember " ..."

ember

+4

this.resource , resource.index . ResourceRoute, ResourceController .

, @mikegrassotti , , , "" "" "" "" ( /) / .

<script type="text/x-handlebars" data-template-name="recipes/index">
<ul>
  {{#each}}
    <li>{{recipe}}</li>  
  {{/each}}
</ul>

. , ember new.hbs show.hbs {{outlet}} application.hbs

+1

Ember.js , . .

.

0

All Articles