Last active
March 20, 2017 16:26
-
-
Save ro0gr/2f8773fdb99145b5ec3a5d8dc01a077b to your computer and use it in GitHub Desktop.
loosing query params in intermediateTransition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle' | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| import config from './config/environment'; | |
| const Router = Ember.Router.extend({ | |
| location: 'none', | |
| rootURL: config.rootURL | |
| }); | |
| Router.map(function() { | |
| this.route('processing'); // i'm intermediate route | |
| this.route('pending'); | |
| }); | |
| export default Router; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Route.extend({ | |
| queryParams: { | |
| wannaToBeAlive: { | |
| refreshModel: true | |
| } | |
| }, | |
| model(params, {queryParams}) { | |
| console.log('application query params', queryParams) | |
| return queryParams; | |
| }, | |
| actions: { | |
| didTransition() { | |
| const { model } = this.controller; | |
| this.intermediateTransitionTo('processing', { | |
| queryParams: model | |
| }); | |
| } | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Route.extend({ | |
| actions: { | |
| didTransition() { | |
| setTimeout(() => { | |
| console.log('tranitionto visa') | |
| this.transitionTo('application', { | |
| queryParams: { | |
| wannaToBeAlive: "1" | |
| } | |
| }); | |
| }, 2000) | |
| } | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "0.11.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-data": "2.11.0", | |
| "ember-template-compiler": "release", | |
| "ember-testing": "release" | |
| }, | |
| "addons": {} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment