Skip to content

Commit

Permalink
[DOC release] document QP-only transitionTo in router service
Browse files Browse the repository at this point in the history
(cherry picked from commit f06f1e2)
  • Loading branch information
chriskrycho authored and kategengler committed Feb 25, 2020
1 parent bdd32b1 commit 731ee32
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/@ember/-internals/routing/lib/services/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export default class RouterService extends Service {
See the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.
In the following example we use the Router service to navigate to a route with a
specific model from a Component.
specific model from a Component in the first action, and in the second we trigger
a query-params only transition.
```app/components/example.js
import Component from '@glimmer/component';
Expand All @@ -106,6 +107,13 @@ export default class RouterService extends Service {
goToComments(post) {
this.router.transitionTo('comments', post);
}
@action
fetchMoreComments(latestComment) {
this.router.transitionTo({
queryParams: { commentsAfter: latestComment }
});
}
}
```
Expand Down

0 comments on commit 731ee32

Please sign in to comment.