Is there a way to get the data
params in a component that is outisde of router outlet.
const appRoutes: Routes = [
{ path: '', component: SitesComponent },
{ path: 'pollutants/newpollutant', component: PollutantComponent, data: { new: true, crumbs: ["New pollutant"] } }
];
Component
export class BreadcrumbsComponent implements OnInit {
list: any[] = [] as any[];
constructor( private router: Router) {
}
ngOnInit() {
this.router.events.subscribe((val) => {
if (val instanceof NavigationEnd)
console.log(val);
});
}
}
Capturing navigation end as above only gives me url.