Disable Back button in browser

3,220 views
Skip to first unread message

Sivaprakash Gopal

unread,
Sep 24, 2019, 12:04:03 PM9/24/19
to Angular and AngularJS discussion
Hi All,

We are using Angular 7. 
How to disable back button in the browser 

Thanks

Kamil Kaplan

unread,
Sep 25, 2019, 1:22:18 AM9/25/19
to ang...@googlegroups.com
import { PlatformLocation } from ‘@angular/common’;
    constructor(location: PlatformLocation, private router: Router) {
    location.onPopState(() => {
    console.log(‘pressed back in add!!!!!’);
    //this.router.navigateByUrl(‘/multicomponent’);
    //history.forward();
});

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angular/572c6c00-7a4b-49e7-a648-c1f3be0c15f3%40googlegroups.com.

siva prakash

unread,
Oct 8, 2019, 10:53:13 PM10/8/19
to ang...@googlegroups.com
it is working in chrome but not working other browser



Ketan Lawande

unread,
May 23, 2020, 6:55:03 AM5/23/20
to Angular and AngularJS discussion
witch file is used code in apication



On Wednesday, September 25, 2019 at 10:52:18 AM UTC+5:30, Kamil Kaplan wrote:
import { PlatformLocation } from ‘@angular/common’;
    constructor(location: PlatformLocation, private router: Router) {
    location.onPopState(() => {
    console.log(‘pressed back in add!!!!!’);
    //this.router.navigateByUrl(‘/multicomponent’);
    //history.forward();
});

On Tue, Sep 24, 2019 at 7:04 PM Sivaprakash Gopal <sivapr...@gmail.com> wrote:
Hi All,

We are using Angular 7. 
How to disable back button in the browser 

Thanks

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ang...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages