Skip to content

fix(router): do not finish bootstrap until all the routes are resolve…#15121

Merged
chuckjaz merged 1 commit into
angular:2.4.xfrom
vsavkin:router_bootstrap_24x_cherry_pick
Mar 16, 2017
Merged

fix(router): do not finish bootstrap until all the routes are resolve…#15121
chuckjaz merged 1 commit into
angular:2.4.xfrom
vsavkin:router_bootstrap_24x_cherry_pick

Conversation

@vsavkin
Copy link
Copy Markdown
Contributor

@vsavkin vsavkin commented Mar 13, 2017

…d (#14762)

Cherry-pick of 5df998d onto 2.4.x branch.

DEPRECATION:

Use RouterModule.forRoot(routes, {initialNavigation: 'enabled'}) instead of
RouterModule.forRoot(routes, {initialNavigtaion: true}).

Before doing this, move the initialization logic affecting the router
from the bootstrapped component to the boostrapped module.

Similarly, use RouterModule.forRoot(routes, {initialNavigation: 'disabled'})
instead of RouterModule.forRoot(routes, {initialNavigation: false}).

Deprecated options: 'legacy_enabled', true (same as 'legacy_enabled'),
'legacy_disabled', false (same as 'legacy_disabled').

The "Router Initial Navigation" design document covers this change.
Read more here:
https://docs.google.com/document/d/1Hlw1fPaVs-PCj5KPeJRKhrQGAvFOxdvTlwAcnZosu5A/edit?usp=sharing

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

What is the new behavior?

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[ ] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@vsavkin vsavkin force-pushed the router_bootstrap_24x_cherry_pick branch 2 times, most recently from d053ee8 to 0be2dcd Compare March 13, 2017 21:40
angular#14762)

Cherry-pick of 5df998d onto 2.4.x branch.

DEPRECATION:

Use `RouterModule.forRoot(routes, {initialNavigation: 'enabled'})` instead of
`RouterModule.forRoot(routes, {initialNavigtaion: true})`.

Before doing this, move the initialization logic affecting the router
from the bootstrapped component to the boostrapped module.

Similarly, use `RouterModule.forRoot(routes, {initialNavigation: 'disabled'})`
instead of `RouterModule.forRoot(routes, {initialNavigation: false})`.

Deprecated options: 'legacy_enabled', `true` (same as 'legacy_enabled'),
'legacy_disabled', `false` (same as 'legacy_disabled').

The "Router Initial Navigation" design document covers this change.
Read more here:
https://docs.google.com/document/d/1Hlw1fPaVs-PCj5KPeJRKhrQGAvFOxdvTlwAcnZosu5A/edit?usp=sharing
@vsavkin vsavkin force-pushed the router_bootstrap_24x_cherry_pick branch from 0be2dcd to d237d66 Compare March 13, 2017 21:55
@vicb vicb added area: i18n Issues related to localization and internationalization action: merge The PR is ready for merge by the caretaker labels Mar 13, 2017
@DzmitryShylovich
Copy link
Copy Markdown
Contributor

@vicb wrong label

@vicb vicb added area: router and removed area: i18n Issues related to localization and internationalization labels Mar 13, 2017
@vicb
Copy link
Copy Markdown
Contributor

vicb commented Mar 13, 2017

@DzmitryShylovich thanks !

@chuckjaz chuckjaz merged commit 34403cd into angular:2.4.x Mar 16, 2017
@arlowhite
Copy link
Copy Markdown

@angular/cli: 1.0.0-rc.2
node: 6.9.1
os: linux x64
@angular/common: 2.4.10
@angular/router: 3.4.10

The value of this.router.url during ngOnInit() of my AppComponent is always "/" instead of the true URL regardless of initialNavigation 'enabled' or 'disabled'

this.router.url updates to the true URL after AppComponent is created and lifecycle finishes.

I was hoping this change would cause the router URL to be updated before AppComponent.ngOnInit()

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: router cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants