UPDATE: this code is deprecated due to changes in the Ember api.
I have reached a point where I can say that I have found a solution that is better for me.
<script type="text/x-handlebars" data-template-name="application"> <div class="container"> <div class="toolbar">{{outlet toolbar}}</div> <div class="main">{{outlet dashboard}}</div> <div class="sidebar">{{outlet sidebar}}</div> </div> </script>
Using such an application template, I can choose where to make representations. Like this:
App.router = Ember.Router.create({ enableLogging: true, location: 'history', root: Ember.Route.extend({ index: Ember.Route.extend({ route: '/admin/', redirectsTo: 'login' }), login: Ember.Route.extend({ route: '/admin/login/', doLogin: function(router, context) { "use strict"; router.transitionTo('dashboard', context); }, connectOutlets: function (router, context) { "use strict"; router.get('applicationController').connectOutlet('login', "login"); } }), dashboard: Ember.Route.extend({ route: '/admin/dashboard/', doLogout: function(router, context) { "use strict"; router.transitionTo('login', context); }, connectOutlets: function (router, context) { "use strict"; router.get('applicationController').connectOutlet('sidebar', 'sidebar'); router.get('applicationController').connectOutlet('toolbar', 'toolbar'); router.get('applicationController').connectOutlet('dashboard', 'dashboard'); } }) }) });
I have three kinds that are not important from the point of view of the solution, which appear in their conclusions.
Hope this helps others.
Eduárd Moldován Sep 02 2018-12-12T00: 00Z
source share