this.router.navigate([this.foo, this.bar], { relativeTo: this.baz });
So if foo above holds /recreation/companionship/pets/ and bar holds "kittens" then we are going off to http://www.example.com/#/recreation/companionship/pets/kittens alright? What is above kinda assumes wireups like so:
- import { Router } from '@angular/router';
- constructor(private router: Router) {
A way to do this sort of thing inside of an HTML tag in a template is like so:
<a [routerLink]="[this.foo, this.bar]">
No comments:
Post a Comment