Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router without <router-outlet> #18253

Closed
jurito opened this Issue Jul 20, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@jurito
Copy link

jurito commented Jul 20, 2017

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request

Current behavior

In an app with custom routing behavior (without router-outlet) everything works fine but when navigating from a path with a parameter to the same path with another parameter value.
It then crashes with the error TypeError: Cannot read property 'component' of null in the router function PreActivation.traverseRoutes

Expected behavior

No error, or not being able to use the router without any outlets.

Minimal reproduction of the problem with instructions

  • plunkr (watch the console)
  • navigate from crisis center to hero 11 --> OK
  • navigate from hero 11 to heroes --> OK
  • navigate from hero 11 to hero 12--> NavigationError

All angular libraries updated to version 4.3.1

@jurito

This comment has been minimized.

Copy link
Author

jurito commented Jul 25, 2017

This issue is solved by adding a 'never' configuration parameter to the Route's RunGuardsAndResolvers configuration option, as seen in 1d7b9f93ec91f488366d86be7c0ce196f32ed956 . If desired, i'll submit a pull request.

@jurito jurito closed this Jul 25, 2017

@jurito jurito reopened this Jul 25, 2017

@VagrantAI-c

This comment has been minimized.

Copy link

VagrantAI-c commented Oct 27, 2017

Actually the problem is still relevant, any new info on this? Maybe this PR is somehow related too #19374

@ngbot ngbot bot added this to the Backlog milestone Jan 23, 2018

jasonaden added a commit to jasonaden/angular that referenced this issue Oct 16, 2018

jasonaden added a commit to jasonaden/angular that referenced this issue Oct 30, 2018

feat(router): add initialNavOnly mode for runGuardsAndResolvers
This option means guards and resolvers will only run the first
time a particular route is navigated to. Changes to params in
any way will not cause guards and resolvers to re-run. They
will only re-run when changing to a new route.

Related to discussion in angular#18253
FW-560 #resolve

jasonaden added a commit to jasonaden/angular that referenced this issue Oct 30, 2018

feat(router): add initialNavOnly mode for runGuardsAndResolvers
This option means guards and resolvers will only run the first
time a particular route is navigated to. Changes to params in
any way will not cause guards and resolvers to re-run. They
will only re-run when changing to a new route.

Related to discussion in angular#18253
FW-560 #resolve

jasonaden added a commit to jasonaden/angular that referenced this issue Oct 30, 2018

feat(router): add initialNavOnly mode for runGuardsAndResolvers
This option means guards and resolvers will only run the first
time a particular route is navigated to. Changes to params in
any way will not cause guards and resolvers to re-run. They
will only re-run when changing to a new route.

Related to discussion in angular#18253
FW-560 #resolve

jasonaden added a commit to jasonaden/angular that referenced this issue Nov 1, 2018

feat(router): add pathParamsChange mode for runGuardsAndResolvers
This option means guards and resolvers will ignore changes to optional
parameters such as query and matrix params. When the path or any path
params change, guards and resolvers will be run

Related to discussion in angular#18253
FW-560 #resolve

kara added a commit that referenced this issue Nov 1, 2018

@kara kara closed this in 496372d Nov 1, 2018

sculove added a commit to sculove/angular that referenced this issue Nov 2, 2018

jasonaden added a commit to jasonaden/angular that referenced this issue Nov 5, 2018

feat(router): add pathParamsChange mode for runGuardsAndResolvers
This option means guards and resolvers will ignore changes to optional
parameters such as query and matrix params. When the path or any path
params change, guards and resolvers will be run

Related to discussion in angular#18253
FW-560 #resolve

jasonaden added a commit to jasonaden/angular that referenced this issue Nov 13, 2018

feat(router): add pathParamsChange mode for runGuardsAndResolvers
This option means guards and resolvers will ignore changes to optional
parameters such as query and matrix params. When the path or any path
params change, guards and resolvers will be run

Related to discussion in angular#18253
FW-560 #resolve

jasonaden added a commit to jasonaden/angular that referenced this issue Nov 13, 2018

feat(router): add pathParamsChange mode for runGuardsAndResolvers
This option means guards and resolvers will ignore changes to optional
parameters such as query and matrix params. When the path or any path
params change, guards and resolvers will be run

Related to discussion in angular#18253
FW-560 #resolve

jasonaden added a commit to jasonaden/angular that referenced this issue Nov 13, 2018

feat(router): add pathParamsChange mode for runGuardsAndResolvers
This option means guards and resolvers will ignore changes to optional
parameters such as query and matrix params. When the path or any path
params change, guards and resolvers will be run

Related to discussion in angular#18253
FW-560 #resolve

AndrewKushnir added a commit that referenced this issue Nov 14, 2018

feat(router): add pathParamsChange mode for runGuardsAndResolvers (#2…
…6861)

This option means guards and resolvers will ignore changes to optional
parameters such as query and matrix params. When the path or any path
params change, guards and resolvers will be run

Related to discussion in #18253
FW-560 #resolve

PR Close #26861

jasonaden added a commit to jasonaden/angular that referenced this issue Dec 4, 2018

feat(router): add pathOrQueryParamsChange mode for runGuardsAndResolvers
This option means guards and resolvers will ignore changes to matrix parameters. Guards and resolvers will be rerun when the path changes, when path parameters change, or when query parameters change.

Related to angular#26861 angular#18253

Related to discussion in angular#18253

jasonaden added a commit to jasonaden/angular that referenced this issue Dec 4, 2018

feat(router): add pathOrQueryParamsChange mode for runGuardsAndResolvers
This option means guards and resolvers will ignore changes to matrix parameters. Guards and resolvers will be rerun when the path changes, when path parameters change, or when query parameters change.

The primary use case for such a mode is when updating the UI and getting the URL to be in sync with local changes. For example, if displaying a sortable table, changing the sort direction is often handled by the table itself. But you would want to update the URL to be in sync with what's being displayed to the user. As long as the table sort direction is stored as a matrix parameter, you can use this option to update the URL without causing the overhead of re-running guards and resolvers.

Related to angular#26861 angular#18253

jasonaden added a commit to jasonaden/angular that referenced this issue Dec 4, 2018

feat(router): add pathParamsOrQueryParamsChange mode for runGuardsAnd…
…Resolvers

This option means guards and resolvers will ignore changes to matrix parameters. Guards and resolvers will be rerun when the path changes, when path parameters change, or when query parameters change.

The primary use case for such a mode is when updating the UI and getting the URL to be in sync with local changes. For example, if displaying a sortable table, changing the sort direction is often handled by the table itself. But you would want to update the URL to be in sync with what's being displayed to the user. As long as the table sort direction is stored as a matrix parameter, you can use this option to update the URL without causing the overhead of re-running guards and resolvers.

Related to angular#26861 angular#18253

jasonaden added a commit to jasonaden/angular that referenced this issue Dec 5, 2018

feat(router): add pathParamsOrQueryParamsChange mode for runGuardsAnd…
…Resolvers

This option means guards and resolvers will ignore changes to matrix parameters. Guards and resolvers will be rerun when the path changes, when path parameters change, or when query parameters change.

The primary use case for such a mode is when updating the UI and getting the URL to be in sync with local changes. For example, if displaying a sortable table, changing the sort direction is often handled by the table itself. But you would want to update the URL to be in sync with what's being displayed to the user. As long as the table sort direction is stored as a matrix parameter, you can use this option to update the URL without causing the overhead of re-running guards and resolvers.

Related to angular#26861 angular#18253

jasonaden added a commit to jasonaden/angular that referenced this issue Dec 5, 2018

feat(router): add pathParamsOrQueryParamsChange mode for runGuardsAnd…
…Resolvers

This option means guards and resolvers will ignore changes to matrix parameters. Guards and resolvers will be rerun when the path changes, when path parameters change, or when query parameters change.

The primary use case for such a mode is when updating the UI and getting the URL to be in sync with local changes. For example, if displaying a sortable table, changing the sort direction is often handled by the table itself. But you would want to update the URL to be in sync with what's being displayed to the user. As long as the table sort direction is stored as a matrix parameter, you can use this option to update the URL without causing the overhead of re-running guards and resolvers.

Related to angular#26861 angular#18253

jasonaden added a commit to jasonaden/angular that referenced this issue Dec 5, 2018

feat(router): add pathParamsOrQueryParamsChange mode for runGuardsAnd…
…Resolvers

This option means guards and resolvers will ignore changes to matrix parameters. Guards and resolvers will be rerun when the path changes, when path parameters change, or when query parameters change.

The primary use case for such a mode is when updating the UI and getting the URL to be in sync with local changes. For example, if displaying a sortable table, changing the sort direction is often handled by the table itself. But you would want to update the URL to be in sync with what's being displayed to the user. As long as the table sort direction is stored as a matrix parameter, you can use this option to update the URL without causing the overhead of re-running guards and resolvers.

Related to angular#26861 angular#18253

IgorMinar added a commit that referenced this issue Dec 5, 2018

feat(router): add pathParamsOrQueryParamsChange mode for runGuardsAnd…
…Resolvers (#27464)

This option means guards and resolvers will ignore changes to matrix parameters. Guards and resolvers will be rerun when the path changes, when path parameters change, or when query parameters change.

The primary use case for such a mode is when updating the UI and getting the URL to be in sync with local changes. For example, if displaying a sortable table, changing the sort direction is often handled by the table itself. But you would want to update the URL to be in sync with what's being displayed to the user. As long as the table sort direction is stored as a matrix parameter, you can use this option to update the URL without causing the overhead of re-running guards and resolvers.

Related to #26861 #18253

PR Close #27464

jasonaden added a commit to jasonaden/angular that referenced this issue Dec 14, 2018

feat(router): add predicate function mode for runGuardsAndResolvers
This option means guards and resolvers will ignore changes when a provided predicate function returns `false`. This supports use cases where an application needs to ignore some param updates but not others. For example, changing a sort param in the URL might need to be ignored, whereas changing the a `project` param might require re-run of guards and resolvers.

Related to angular#26861 angular#18253 angular#27464

jasonaden added a commit to jasonaden/angular that referenced this issue Dec 17, 2018

feat(router): add predicate function mode for runGuardsAndResolvers
This option means guards and resolvers will ignore changes when a provided predicate function returns `false`. This supports use cases where an application needs to ignore some param updates but not others. For example, changing a sort param in the URL might need to be ignored, whereas changing the a `project` param might require re-run of guards and resolvers.

Related to angular#26861 angular#18253 angular#27464

mhevery added a commit that referenced this issue Dec 18, 2018

feat(router): add predicate function mode for runGuardsAndResolvers (#…
…27682)

This option means guards and resolvers will ignore changes when a provided predicate function returns `false`. This supports use cases where an application needs to ignore some param updates but not others. For example, changing a sort param in the URL might need to be ignored, whereas changing the a `project` param might require re-run of guards and resolvers.

Related to #26861 #18253 #27464

PR Close #27682

IgorMinar added a commit to IgorMinar/angular that referenced this issue Dec 19, 2018

feat(router): add predicate function mode for runGuardsAndResolvers (a…
…ngular#27682)

This option means guards and resolvers will ignore changes when a provided predicate function returns `false`. This supports use cases where an application needs to ignore some param updates but not others. For example, changing a sort param in the URL might need to be ignored, whereas changing the a `project` param might require re-run of guards and resolvers.

Related to angular#26861 angular#18253 angular#27464

PR Close angular#27682

IgorMinar added a commit to IgorMinar/angular that referenced this issue Dec 19, 2018

feat(router): add predicate function mode for runGuardsAndResolvers (a…
…ngular#27682)

This option means guards and resolvers will ignore changes when a provided predicate function returns `false`. This supports use cases where an application needs to ignore some param updates but not others. For example, changing a sort param in the URL might need to be ignored, whereas changing the a `project` param might require re-run of guards and resolvers.

Related to angular#26861 angular#18253 angular#27464

PR Close angular#27682

FrederikSchlemmer added a commit to FrederikSchlemmer/angular that referenced this issue Jan 3, 2019

FrederikSchlemmer added a commit to FrederikSchlemmer/angular that referenced this issue Jan 3, 2019

feat(router): add pathParamsChange mode for runGuardsAndResolvers (an…
…gular#26861)

This option means guards and resolvers will ignore changes to optional
parameters such as query and matrix params. When the path or any path
params change, guards and resolvers will be run

Related to discussion in angular#18253
FW-560 #resolve

PR Close angular#26861

FrederikSchlemmer added a commit to FrederikSchlemmer/angular that referenced this issue Jan 3, 2019

feat(router): add pathParamsOrQueryParamsChange mode for runGuardsAnd…
…Resolvers (angular#27464)

This option means guards and resolvers will ignore changes to matrix parameters. Guards and resolvers will be rerun when the path changes, when path parameters change, or when query parameters change.

The primary use case for such a mode is when updating the UI and getting the URL to be in sync with local changes. For example, if displaying a sortable table, changing the sort direction is often handled by the table itself. But you would want to update the URL to be in sync with what's being displayed to the user. As long as the table sort direction is stored as a matrix parameter, you can use this option to update the URL without causing the overhead of re-running guards and resolvers.

Related to angular#26861 angular#18253

PR Close angular#27464

ngfelixl added a commit to ngfelixl/angular that referenced this issue Jan 28, 2019

feat(router): add pathParamsOrQueryParamsChange mode for runGuardsAnd…
…Resolvers (angular#27464)

This option means guards and resolvers will ignore changes to matrix parameters. Guards and resolvers will be rerun when the path changes, when path parameters change, or when query parameters change.

The primary use case for such a mode is when updating the UI and getting the URL to be in sync with local changes. For example, if displaying a sortable table, changing the sort direction is often handled by the table itself. But you would want to update the URL to be in sync with what's being displayed to the user. As long as the table sort direction is stored as a matrix parameter, you can use this option to update the URL without causing the overhead of re-running guards and resolvers.

Related to angular#26861 angular#18253

PR Close angular#27464

ngfelixl added a commit to ngfelixl/angular that referenced this issue Jan 28, 2019

feat(router): add predicate function mode for runGuardsAndResolvers (a…
…ngular#27682)

This option means guards and resolvers will ignore changes when a provided predicate function returns `false`. This supports use cases where an application needs to ignore some param updates but not others. For example, changing a sort param in the URL might need to be ignored, whereas changing the a `project` param might require re-run of guards and resolvers.

Related to angular#26861 angular#18253 angular#27464

PR Close angular#27682
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.