Skip to content

Instantly share code, notes, and snippets.

@rwjblue
Last active February 9, 2017 20:55
Show Gist options
  • Save rwjblue/a64873c1356dc1e4e8590a6346906f31 to your computer and use it in GitHub Desktop.
Save rwjblue/a64873c1356dc1e4e8590a6346906f31 to your computer and use it in GitHub Desktop.
New Twiddle
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('bar', function() {
this.route('baz');
});
});
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
beforeModel() {
this.transitionTo('foo.bar.baz');
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
<h3>foo.bar.baz</h3>
Notice no wrapping <code>div</code> below the main application template.
<h2>Foo</h2>
{{outlet}}
{
"version": "0.11.0",
"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.11.0",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment