Handle Back button with Angular [Chrome]

Discussão em 'Angular' iniciado por Karan, Janeiro 20, 2025.

  1. Karan

    Karan Guest

    I am creating a project using angular, In my application I need to handle back button event. Below is the code which is working fine apart from one scenario

    Code:

    this.location.subscribe(event => {
    //logout
    });
    history.pushState({}, '');


    This code only works when user is perform some activity, if user just landed on page and click back button then this event is not captured. I tried all the ways but not works.

    Continue reading...

Compartilhe esta Página