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.Controller.extend({
appName: 'Ember Twiddle',
actions: {
retry() {
this.get('retryTransition').retry();
}
}
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('blog');
this.route('author');
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
actions: {
transitionAndRetry() {
let t = this.transitionTo('author');
t.abort();
this.transitionTo('blog');
let appController = this.controllerFor('application');
appController.set('retryTransition', t);
}
}
});
<h1>Welcome to {{appName}}</h1>
{{#link-to 'index'}}Home{{/link-to}}
{{#link-to 'blog'}}Blog{{/link-to}}
{{#link-to 'author'}}Author{{/link-to}}
<br>
<button {{action "transitionAndRetry"}}>Transition And Abort</button>
<button {{action "retry"}}>Retry Transition</button>
<br>
<br>
{{outlet}}
<br>
<br>
{
"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.12.0",
"ember-template-compiler": "beta",
"ember-testing": "beta"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment