Skip to content

Commit e265925

Browse files
author
Jen Weber
authored
Merge pull request #196 from ynotdraw/transitioning-section
Explain how to transition between Routes (#157)
2 parents 9822f1c + 2a88425 commit e265925

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

guides/v3.4.0/routing/defining-your-routes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,3 +278,11 @@ need to create a route handler. The following guides will explore the different
278278
features of route handlers. For more information on routes, see the API documentation
279279
for [the router](https://www.emberjs.com/api/ember/release/classes/EmberRouter) and for [route
280280
handlers](https://www.emberjs.com/api/ember/release/classes/Route).
281+
282+
## Transitioning Between Routes
283+
Once the routes are defined, how do we go about transitioning between them within our application? It depends on where the transition needs to take place:
284+
285+
- From a template, use [`{{link-to}}`](https://emberjs.com/api/ember/release/classes/Ember.Templates.helpers/methods/link-to?anchor=link-to) as mentioned above
286+
- From a route, use the [`transitionTo()`](https://emberjs.com/api/ember/release/classes/Route/methods/transitionTo?anchor=transitionTo) method
287+
- From a controller, use the [`transitionToRoute()`](https://emberjs.com/api/ember/release/classes/Controller/methods/transitionToRoute?anchor=transitionToRoute) method
288+
- From anywhere else in your application, such as a component, inject the [Router Service](https://emberjs.com/api/ember/release/classes/RouterService) and use the [`transitionTo()`](https://emberjs.com/api/ember/release/classes/RouterService/methods/transitionTo?anchor=transitionTo) method

0 commit comments

Comments
 (0)