Skip to content

Instantly share code, notes, and snippets.

@Eric162
Last active August 20, 2018 21:34
Show Gist options
  • Select an option

  • Save Eric162/05465223241b4a82dab48d64218d9549 to your computer and use it in GitHub Desktop.

Select an option

Save Eric162/05465223241b4a82dab48d64218d9549 to your computer and use it in GitHub Desktop.
relative link-to
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('foo', function(){
this.route('comments', function() {
this.route('add', { resetNamespace: true } );
});
});
this.route('bar', function(){
this.route('comments', function(){
this.route('add', { resetNamespace: true });
});
});
});
export default Router;
<h1>Welcome to Weird Behavior</h1>
<br>
{{#link-to "add"}}
Foo comments
{{/link-to}}
<br>
--------------------------------
<br>
{{outlet}}
<br>
<br>
|- Bar Comments Route Template
<br>
{{outlet}}
|- Foo Comments Route Template
<br/>
{{link-to "add" "add"}}
{{outlet}}
{
"version": "0.13.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.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment