How to navigate in Angular 4 with filter url subscribe -
i want change url in browser without notify activatedroute changes, run code in subscribe of url, when component initializing or user click in browser undo/redo
ngoninit() { this.form = this.initform(); this.activatedroute.url.subscribe(params => { //run when component loading or user click undo/redo in browser this.form = this.initform(); }); } public submit(): void { let url = this.urlbuilder.build(this.form); //change url in browser , add history, without notify activatedroute changes this.router.navigatebyurl(url); }
Comments
Post a Comment