Replace parent view from child route

Following my question here Nested Routes in Ember I would like to replace the view displayed from /settings/users/ with the view displayed /settings/users/1 .

My routes are defined as:

 Router.map(function() { this.route('login'); this.resource('settings', { path: 'settings/:settings_id' }, function() { this.route('overview'); this.route('users', function() { this.route('user', { path: ':user_id' }); }); }); }); 

My user.hbs template will be displayed when users.hbs contains {{outlet}} . I want user.hbs display instead of users.hbs not inside it.

+5
source share
1 answer

Change users pattern only on exit

 {{outlet}} 

And put the material from the template of your users into your users/index template, then it will only be displayed when you are on the users route, and when you go deeper, it will not show the index route.

 Cool stuff in the users index template 

Example: http://emberjs.jsbin.com/jacebeyira/1/edit?html,js,output

+10
source

Source: https://habr.com/ru/post/1210237/


All Articles