-
Notifications
You must be signed in to change notification settings - Fork 123
Conversation
Update
@guardrex This PR has been sitting around for a while. Does it just need to be reviewed? Looks like it needs to be rebased. |
@danroth27 It just needs a review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small changes but otherwise looks good.
docs/routing.md
Outdated
|
||
## Route templates | ||
|
||
Routing in Blazor is achieved by providing a route template to each accessible component in the app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Routing only works if you first add the Router component to your app. In our templates this is done in App.cshtml
<Router AppAssembly=typeof(Program).Assembly />
Setting up the Router component will probably move to Program.cs some day, but for now this is how it's done.
docs/routing.md
Outdated
|
||
## Route parameters | ||
|
||
Blazor components can receive route parameters from the route template provided in the `@page` directive. The Blazor client-side router uses route parameters to populate the corresponding component parameters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Blazor client-side router uses route parameters to populate the corresponding component parameters with the same name (case insensitive).
docs/routing.md
Outdated
|
||
[!code-cshtml[](components/common/samples/2.x/ComponentsSample/Pages/RouteParameter.cshtml?start=1&end=8)] | ||
|
||
Optional parameters aren't supported, so two `@page` directives are applied in the example above. The first permits navigation to the component without a parameter. The second `@page` directive takes the `{text}` route parameter and assigns the value to the `Text` property. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional parameters aren't supported yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I say that, and I'm explaining why there are two oh ... YET ... you caught me at the end of a long day again ... brain fry! 😵 lol@page
directives present and how the workaround works. Are you saying u want this removed?
@danroth27 Updates complete 🎸 Check Line 26 tho on the Router component to see if that's what you want there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #72