Skip to content

Instantly share code, notes, and snippets.

@nightire
Forked from Eteokles/controllers.application.js
Last active December 9, 2016 17:46
Show Gist options
  • Save nightire/ee8ac0daa55ab9c87a673fefe3727f11 to your computer and use it in GitHub Desktop.
Save nightire/ee8ac0daa55ab9c87a673fefe3727f11 to your computer and use it in GitHub Desktop.
Nested route, multiple outlet and renderTemplate problem
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Nested Route Problem'
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('first-entry');
this.route('second-entry', function () {
this.route('index', {path: "/"}, function () {
this.route('list-view', {path: '/list'});
this.route('group-view', {path: '/'});
});
});
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
});
import Ember from 'ember';
export default Ember.Route.extend({
});
import Ember from 'ember';
export default Ember.Route.extend({
renderTemplate: function () {
this._super(...arguments);
this.render('second-entry/index/quickmenu', {
outlet: "quickmenu",
into: "application"
});
},
});
import Ember from 'ember';
export default Ember.Route.extend({
});
import Ember from 'ember';
export default Ember.Route.extend({
});
<h1>Welcome to {{appName}}</h1>
{{#link-to 'first-entry'}}First{{/link-to}}
{{#link-to 'second-entry'}}Second{{/link-to}}
<br>
<br>
{{outlet}}
<br>
<br>
{{outlet 'quickmenu'}}
This is the first page
{{#link-to 'second-entry.index.list-view'}}List{{/link-to}}
{{#link-to 'second-entry'}}Group{{/link-to}}
{
"version": "0.10.6",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.9.0",
"ember-data": "2.9.0",
"ember-template-compiler": "2.9.0",
"ember-testing": "2.9.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment