How can I reset browser's navigation history in angular2?

Viewed 6829

I want to clear browser navigation history in angular2 so that after user get navigated to particular page (page of my interest) the shouldn't be able to go back or forward by clicking browser back or next button.......

For now I tried importing Angular2 Location like this

 import {Location} from "angular2/router";

and using it like this to prevent navigation

 this._location.replaceState('/'); //clear browser navigation history and reset it to root /
 this._router.navigateByUrl('/home');

Note: assume Location and Router are properly injected

But its not working.

1 Answers
Related