http://plnkr.co/edit/UHeuW7QIFhHnHVT8itoj?p=preview
this is a plunkr provided by google to demo relative navigation:
export class CrisisListComponent implements OnActivate {
crises: Crisis[];
private currSegment: RouteSegment;
private selectedId: number;
constructor(
private service: CrisisService,
private router: Router) { }
isSelected(crisis: Crisis) { return crisis.id === this.selectedId; }
routerOnActivate(curr: RouteSegment, prev: RouteSegment, currTree: RouteTree) {
this.currSegment = curr;
this.selectedId = +currTree.parent(curr).getParam('id');
this.service.getCrises().then(crises => this.crises = crises);
}
onSelect(crisis: Crisis) {
// Absolute link
// this.router.navigate([`/crisis-center`, crisis.id]);
// Relative link
this.router.navigate([`./${crisis.id}`], this.currSegment);
}
}
Now in my version of Chrome the Browsers Forward-Button will not work correctly after I clicked on the Back-Button.
Reproduce error:
expected: forward-button to be enabled and leading to the detailed view of the clicked item
Is this a bug or am I missing something?
That's a known issue with @angular/router https://github.com/angular/angular/issues/9088
This router will again be replaced. The new new router is work in progress but will probably be made available soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With