feat(router): Add `Route.metatags` and `Route.pageDescription` to Route definitions
- Langage dominant
- TypeScript
- Étoiles
- 101k
- Forks
- 27.5k
- Merge moyen
- 1 j 19 h
- PR mergées (30 j)
- 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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par l’API de définition de Route de @angular/router et ses attributs Route.data existants, puis examinez le suivi #7630 et la discussion pour comprendre le périmètre prévu. La réalisation nécessite une conception approuvée par un maintainer pour metatags et pageDescription, y compris les formes de resolver, ainsi qu’un accord sur l’inclusion éventuelle de données Route supplémentaires.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 30/100