How to reload a page indefinitely?

Discussão em 'Angular' iniciado por Milie24, Setembro 11, 2024.

  1. Milie24

    Milie24 Guest

    The code below reload a page just once after initial page rendering (loading). It does not reload the page after first reload request was made. I want to know how to reload a page indefinitely. In other words, each time a user make a page reload request then it should happen at all time.

    constructor(private router: Router ) {
    this.router.routeReuseStrategy.shouldReuseRoute = () => {
    return false;
    };
    }

    pageReload(){
    this.router.navigate(['/customer'], { queryParams: { namevar: this.namevar } });
    }


    html

    <button (click)="pageReload()" > Refresh</button>

    Continue reading...

Compartilhe esta Página