Skip to content

Instantly share code, notes, and snippets.

@pixelhandler
Forked from poteto/controllers.application.js
Created September 14, 2018 16:40
Show Gist options
  • Save pixelhandler/99d8ea8594f34acbefcb52f7d42c4aa3 to your computer and use it in GitHub Desktop.
Save pixelhandler/99d8ea8594f34acbefcb52f7d42c4aa3 to your computer and use it in GitHub Desktop.
nuked parent route
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'
});
Router.map(function() {
this.route('page', function() {
this.route('show');
});
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
activate() {
this.transitionTo('page.show');
}/*,*/
// beforeModel() {
// this.transitionTo('page.show');
// },
// model() {
// this.transitionTo('page.show');
// },
// afterModel() {
// this.transitionTo('page.show');
// }
});
import Ember from 'ember';
export default Ember.Route.extend({
});
import Ember from 'ember';
export default Ember.Route.extend({
});
<h1>Cageplication</h1>
{{#link-to 'page.index' tagName="button"}}Page.index{{/link-to}}
{{#link-to 'page.show' tagName="button"}}Page.show{{/link-to}}
{{outlet}}
<p>This should never be rendered.</p>
{{#link-to 'index' tagName="button"}}Index{{/link-to}}
<p>Watch me disappear when you navigate to Index! I am a part of the <code>page</code> template.</p>
{{outlet}}
<pre>I am the page/index route.</pre>
<img src="http://www.placecage.com/c/400/400">
<pre>I am the page/show route.</pre>
<img src="http://www.placecage.com/400/400">
{
"version": "0.7.2",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "3.4.1",
"ember-template-compiler": "3.4.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment