-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE query-params-new] Query params rewrite
See here for some examples: https://gist.github.com/machty/8167051 Depends on Handlebars subexpressions: handlebars-lang/handlebars.js#690
- Loading branch information
Showing
18 changed files
with
2,494 additions
and
1,693 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
test("routeless transitionTo in mid-transition uses transition's destination route for query params, not the router's current route", function() { | ||
expect(2); | ||
Router.map(function() { | ||
this.resource('woot', { path: '/woot' }, function() { | ||
this.route('yeah'); | ||
}); | ||
}); | ||
|
||
App.WootYeahController = Ember.Controller.extend({ | ||
queryParams: ['foo'], | ||
foo: 'lol' | ||
}); | ||
|
||
var redirectCount = 0; | ||
App.WootRoute = Ember.Route.extend({ | ||
redirect: function() { | ||
redirectCount++; | ||
// Keep transitioning to WootYeah but alter its | ||
// query params to foo: 'yeah' | ||
this.transitionTo({ queryParams: { foo: 'yeah' } }); | ||
} | ||
}); | ||
|
||
bootApplication(); | ||
|
||
Ember.run(router, 'transitionTo', 'woot.yeah'); | ||
equal(router.get('location.path'), "/woot/yeah?woot.yeah[foo]=yeah"); | ||
equal(redirectCount, 1, "redirect was only run once"); | ||
}); |
This file contains 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
Oops, something went wrong.