angular / angular/angular

feat(router): Add `Route.metatags` and `Route.pageDescription` to Route definitions

Open
#44,928 11 comments 44 reactions 0 assignees View on GitHub
area: router feature feature: under consideration
Dominant language
TypeScript
Stars
101k
Forks
27.5k
Avg merge
1d 19h
Merged PRs (30d)
288

Description

### Which @angular/* package(s) are relevant/releated to the feature request?

@angular/router

### Description

As a follow up to #7630 it would be nice to also add both `metatags` and `pageDescription` to the router's definition API in order to streamline how developers define routes.

We can also explore what other data is commonly defined and managed with custom strategies in the `Route.data` property to see how else we could simplify Route definitions especially for new developers.

### Proposed solution

```
const routes : Routes = {
path: '',
title: 'Angular Home Page',
metatags: ['home', 'angular'],
pageDescription: 'Home page for Angular documentation',
children: [
{path: 'about', title: 'About Angular', metatags: ['info', 'about'], pageDescription: 'About page for Angular documentation',},
{path: 'docs/:param', title: TitleResolver, metatags: MetatagResolver, pageDescription: PageDescriptionResolver}
]
};
```

### Alternatives considered

Currently this is individually managed and already possible with the `Route.data` additional attributes, which works but is more work for the developer and does not enforce best practices.

Contributor guide

Open the contributing guide

Research direction

Start with the @angular/router Route definition API and its existing Route.data attributes, then review follow-up #7630 and the discussion for the intended scope. Done requires a maintainer-approved design for metatags and pageDescription, including resolver forms, plus agreement on whether additional Route data should be included.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.