Skip to content

Instantly share code, notes, and snippets.

@kellyselden
Created November 8, 2016 21:46
Show Gist options
  • Save kellyselden/7857f7b5d872f9f91ad750c81a36d335 to your computer and use it in GitHub Desktop.
Save kellyselden/7857f7b5d872f9f91ad750c81a36d335 to your computer and use it in GitHub Desktop.
router collision
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('memorials', function() {
// this.route('index', { path: '/' });
this.route('landing', { path: '/' }, function() {
this.route('create');
this.route('share');
});
});
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
renderTemplate() {
//let currentRouteName = this.controllerFor('application').get('currentRouteName');
if (window.location.pathname === 'memorials/landing') {
return this.render('memorials/index');
}
return this._super(...arguments);
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{
"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