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

feat(router): expose resolved route title #46826

Closed
wants to merge 1 commit into from

Conversation

EmmanuelRoux
Copy link
Contributor

@EmmanuelRoux EmmanuelRoux commented Jul 13, 2022

fixes #46825

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #46825

What is the new behavior?

Since Angular 14, router has a new mechanism to update page title from route config. The route can either be a static string or resolved in the same way as resolve data.

But the resolved route title is not exposed and inaccessible from client application (it seems the title is actually stored in the resolved Data, but using a private Symbol so it can't be accessed properly).

This PR adds a new title property on ActivatedRoute and ActivatedRouteSnapshot.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@pullapprove pullapprove bot requested a review from AndrewKushnir July 13, 2022 17:13
@ngbot ngbot bot added this to the Backlog milestone Jul 13, 2022
@EmmanuelRoux EmmanuelRoux force-pushed the expose-route-title branch 2 times, most recently from 93e1afa to 5b71be0 Compare July 13, 2022 18:14
packages/router/src/router_state.ts Outdated Show resolved Hide resolved
packages/router/src/router_state.ts Outdated Show resolved Hide resolved
packages/router/src/router_state.ts Outdated Show resolved Hide resolved
packages/router/test/router_state.spec.ts Outdated Show resolved Hide resolved
@AndrewKushnir AndrewKushnir removed their request for review July 13, 2022 19:27
@EmmanuelRoux EmmanuelRoux changed the title Expose resolved route title feat(router): expose resolved route title Jul 16, 2022
Copy link
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

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

LGTM for the changes. Before we merge, could you please squash the commits into one?

Copy link
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api

@atscott atscott added the action: global presubmit The PR is in need of a google3 global presubmit label Jul 18, 2022
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

Reviewed-for: public-api

Copy link
Contributor

@jessicajaniuk jessicajaniuk left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api

packages/router/src/router_state.ts Outdated Show resolved Hide resolved
Expose resolved route title from ActivatedRoute and ActivatedRouteSnapshot
@atscott atscott added the target: minor This PR is targeted for the next minor release label Jul 20, 2022
@atscott
Copy link
Contributor

atscott commented Jul 20, 2022

caretaker note: This will require patching cl/462221001 when syncing.

@atscott atscott removed the action: global presubmit The PR is in need of a google3 global presubmit label Jul 20, 2022
@atscott
Copy link
Contributor

atscott commented Jul 20, 2022

green TGP with patches

@atscott atscott added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Jul 20, 2022
@ngbot ngbot bot added the action: merge The PR is ready for merge by the caretaker label Jul 20, 2022
@atscott
Copy link
Contributor

atscott commented Jul 20, 2022

merge assistance:

  • This will require patching cl/462221001 when syncing.
  • TGP was green with the local patch but it would be a good idea to merge and sync this on its own

@pkozlowski-opensource
Copy link
Member

This PR was merged into the repository by commit 10289f1.

@angular-automatic-lock-bot
Copy link

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 Aug 21, 2022
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 merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note risk: medium target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose resolved route title
5 participants