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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Adds guide for customizing page titles with TitleStrategy (angular#64238)
Improves documentation by explaining how to implement and configure a custom title strategy for centralized control over page titles
PR Closeangular#64238
Copy file name to clipboardExpand all lines: adev/src/content/guide/routing/define-routes.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -299,6 +299,44 @@ const routes: Routes = [
299
299
300
300
Route titles can also be set via a service extending the [`TitleStrategy`](/api/router/TitleStrategy) abstract class. By default, Angular uses the [`DefaultTitleStrategy`](/api/router/DefaultTitleStrategy).
301
301
302
+
### Using TitleStrategy for page titles
303
+
304
+
For advanced scenarios where you need centralized control over how the document title is composed, implement a `TitleStrategy`.
305
+
306
+
`TitleStrategy` is a token you can provide to override the default title strategy used by Angular. You can supply a custom `TitleStrategy` to implement conventions such as adding an application suffix, formatting titles from breadcrumbs, or generating titles dynamically from route data.
0 commit comments