Skip to content

Commit 832ca86

Browse files
sly7-7Jen Weber
authored andcommitted
Adding note for transitionning to a wildcard route (#143)
* Adding note for transitionning to a wildcard route I just found myself stuck because I forgot this empty parameter (seems like the router interprets the path as a dynamic segment). The error seems intentionnally not thrown, and hard to track down: https://github.com/tildeio/router.js/blob/73d6a7f5ca6fba3cfff8460245fb5a3ceef8a2b5/lib/router/transition-intent/named-transition-intent.ts#L214) * Add a space between code block and text, replace abbreviation * change fake route path to routes
1 parent 1ea0a07 commit 832ca86

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ Router.map(function() {
265265
In the above example we have successfully used a wildcard route to handle all routes not managed by our application
266266
so that when a user navigates to `/a/non-existent/path` they will be shown a message that says the page they're looking for wasn't found.
267267

268+
Note that if you want to manually transition to this wildcard route, you need to pass an arbitrary (not empty) argument. For example:
269+
270+
```javascript {data-filename=app/routes/some-route.js}
271+
this.transitionTo('not-found', 404);
272+
```
273+
268274
## Route Handlers
269275

270276
To have your route do something beyond render a template with the same name, you'll

0 commit comments

Comments
 (0)