I'm passing static route data in my route definition like this:
const routes: Routes = [{ path: '/map',
component: MapComponent,
data: { animation: 'mapPage' } }];
Then access it in my component via:
constructor(private _contexts: ChildrenOutletContexts) { }
getRouteAnimationData(): Data | unknown {
return this._contexts.getContext('primary')?.route?.snapshot?.data?.['animation'];
}
However, I now also have a parameterized route:
const routes: Routes = [{ path: '/record/:type',
component: RecordComponent,
data: { animation: ':typePage' }
Now, of course this will only send the static string ':typePage' and not, 'areaPage' or 'languagePage', depending on the actual value of :type.
Is there a way to get this parameter added to the data value?
i am very unsure that if i gets you correctly ,so pleae elaborate and explain the exact your need in more better .
mean while what you need is use of ParamMap
please let me know more on you requirement if i got you wrong