Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save pixelhandler/108f28a210e22cb3ba5f4c80e619eca2 to your computer and use it in GitHub Desktop.

Select an option

Save pixelhandler/108f28a210e22cb3ba5f4c80e619eca2 to your computer and use it in GitHub Desktop.
parent-child
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('parent', function() {
this.route('child');
});
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return new Ember.RSVP.Promise(function(resolve) {
setTimeout(resolve, 1);
});
}
});
import Ember from 'ember';
export default Ember.Route.extend({
deactivate: function() {
console.log('deactivate!');
}
});
<p>Steps to replicate:
<ol>
<li>go to 'parent'</li>
<li>go to 'parent/child'</li>
</ol>
</p>
<p>Result: parent route#deactivate is called (logged to console)</p>
<br>
{{#link-to 'parent'}}Go to parent{{/link-to}}
<br>
<br>
{{outlet}}
{{#link-to 'parent.child'}}Go to parent/child{{/link-to}}
{
"version": "0.12.1",
"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-template-compiler": "2.9.0",
"ember-testing": "2.9.0"
},
"addons": {
"ember-data": "2.9.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment