Skip to content

Instantly share code, notes, and snippets.

@abhilashlr
Last active June 10, 2018 07:31
Show Gist options
  • Save abhilashlr/0e4a7e54420ec016813ac53afcbfb9ee to your computer and use it in GitHub Desktop.
Save abhilashlr/0e4a7e54420ec016813ac53afcbfb9ee to your computer and use it in GitHub Desktop.
New Twiddle
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
const Router = EmberRouter.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('dashboard');
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
model() {
console.log("Dashboard route is loaded by default");
}
});
import Ember from 'ember';
export default Ember.Route.extend({
redirect() {
this.transitionTo('dashboard');
}
});
Parent application.hbs
<br>
{{outlet}}
<br>
<br>
{
"version": "0.14.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "2.18.2",
"ember-template-compiler": "2.18.2",
"ember-testing": "2.18.2"
},
"addons": {
"ember-data": "2.18.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment