Skip to content

feat(router): expose resolved route title - #46826

Closed
EmmanuelRoux wants to merge 1 commit into
angular:mainfrom
EmmanuelRoux:expose-route-title
Closed

EmmanuelRoux wants to merge 1 commit into
angular:mainfrom
EmmanuelRoux:expose-route-title

Conversation

@EmmanuelRoux

@EmmanuelRoux EmmanuelRoux commented Jul 13, 2022 •

Copy link
Copy Markdown
Contributor

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
@jessicajaniuk
jessicajaniuk requested a review from atscott July 13, 2022 17:18
@EmmanuelRoux
EmmanuelRoux force-pushed the expose-route-title branch 2 times, most recently from 93e1afa to 5b71be0 Compare July 13, 2022 18:14
Comment thread packages/router/src/router_state.ts Outdated
Comment thread packages/router/src/router_state.ts Outdated
Comment thread packages/router/src/router_state.ts Outdated
Comment thread packages/router/test/router_state.spec.ts Outdated
@AndrewKushnir
AndrewKushnir removed their request for review July 13, 2022 19:27
Comment thread packages/router/src/shared.ts Outdated
@EmmanuelRoux
EmmanuelRoux requested a review from atscott July 16, 2022 14:11
@EmmanuelRoux EmmanuelRoux changed the title Expose resolved route title feat(router): expose resolved route title Jul 16, 2022

@atscott atscott left a comment

Copy link
Copy Markdown
Contributor

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?

Comment thread packages/router/src/router_state.ts Outdated
@EmmanuelRoux
EmmanuelRoux requested a review from atscott July 18, 2022 18:51

@atscott atscott left a comment

Copy link
Copy Markdown
Contributor

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

@AndrewKushnir AndrewKushnir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed-for: public-api

@jessicajaniuk jessicajaniuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

reviewed-for: public-api

Comment thread packages/router/src/router_state.ts Outdated
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

atscott commented Jul 20, 2022

Copy link
Copy Markdown
Contributor

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

atscott commented Jul 20, 2022

Copy link
Copy Markdown
Contributor

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

atscott commented Jul 20, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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

@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 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