Open
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.