Skip to content
This repository has been archived by the owner on Apr 20, 2019. It is now read-only.

Routing topic #102

Merged
merged 4 commits into from
Jun 20, 2018
Merged

Routing topic #102

merged 4 commits into from
Jun 20, 2018

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented May 2, 2018

Fixes #72

@danroth27
Copy link
Member

@guardrex This PR has been sitting around for a while. Does it just need to be reviewed? Looks like it needs to be rebased.

@guardrex
Copy link
Collaborator Author

guardrex commented Jun 7, 2018

@danroth27 It just needs a review.

Copy link
Member

@danroth27 danroth27 left a 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.
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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

Copy link
Collaborator Author

@guardrex guardrex Jun 19, 2018

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 @page directives present and how the workaround works. Are you saying u want this removed? oh ... YET ... you caught me at the end of a long day again ... brain fry! 😵 lol

@guardrex
Copy link
Collaborator Author

@danroth27 Updates complete 🎸

Check Line 26 tho on the Router component to see if that's what you want there.

Copy link
Member

@danroth27 danroth27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@guardrex guardrex merged commit e82b688 into master Jun 20, 2018
@guardrex guardrex deleted the guardrex/routing-topic branch June 20, 2018 13:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants