1

I have module that has its routing settings and contains some children modules. How can i navigate to certain routes from some children to parent or to other (sibling) modules?

As i see I could specify a name for the route:

{ path:'/About', name: 'About',   ... }

and then use it:

this.router.parent.navigate(['About']);

Since name is deprecated, do you know how can i reach the same with the latest version of Angular2 router?

smartmouse
  • 13,912
  • 34
  • 100
  • 166

1 Answers1

2

simply use

this.router.navigate(['/XYZ', params_here]);

or if you want to redirect directly to path then you can also use this

this.router.navigateByUrl('/XYZ/ABC');

navigateByUrl accepts simply string

name has been deprecated in the angular2 beta i think, now the routing is working by matching name with the path name

for more info read out here

https://angular.io/docs/ts/latest/guide/router.html

Pardeep Jain
  • 84,110
  • 37
  • 165
  • 215