How to get child routes using parent in angular ,2024

in this blog, we will learn about how to get child routes using parent in angular

Solution 1: get child routes using parent in angular

Source: stackoverflow.com

constructor(private _route: ActivatedRoute, private _router: Router)

this._router.events
.filter(event => event instanceof NavigationEnd)
 .subscribe(
    () => {
       console.log(this._route.snapshot.firstChild.data);
    }
);

Discover more from STRUGGLER KING.COM

Subscribe now to keep reading and get access to the full archive.

Continue Reading