feat(router): Add `Route.metatags` and `Route.pageDescription` to Route definitions
- Linguagem predominante
- TypeScript
- Estrelas
- 101k
- Forks
- 27.5k
- Merge médio
- 1d 19h
- PRs com merge (30d)
- 288
Descrição
### 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.
Guia de contribuição
Direção de pesquisa
Comece pela API de definição de Route de @angular/router e pelos atributos Route.data existentes e, em seguida, revise o follow-up #7630 e a discussão para entender o escopo pretendido. Para considerar o trabalho concluído, é necessário um design aprovado por um maintainer para metatags e pageDescription, incluindo as formas de resolver, além de um acordo sobre a inclusão ou não de dados adicionais de Route.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- angular, typescript
- Domínio
- frontend
- Tipo de issue
- Funcionalidade
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 30/100