Is there anything in Angular 4 I can call where I pass a string or an array of route markers and return the static route data for that route?
For instance:
const targetRoute = '/test/route'
const routeData = {{something}}.getRouteData(targetRoute)
The data I'm looking for is the data defined in the route definitions
const routes: Routes = [
{
path: 'test/route',
data: { //This data object
animation: {
value: 'fetching-results'
},
progress: 100,
sectionIdentifier: {
background: 'results',
backLinkUrl: null,
backLinkText: null
}
},
}
]
tt9 source
share