Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
router: Ember.inject.service(),
actions: {
goToRoute() {
this.get('router').transitionTo('bar');
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
queryParams: ['foo']
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('bar');
});
export default Router;
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{my-component}}
{{outlet}}
<br>
<br>
<button {{action "goToRoute"}}>Try transitioning</button>
{
"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": "release",
"ember-template-compiler": "release",
"ember-testing": "release"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment