How to call function after page fully loaded in Angular?

Discussão em 'Angular' iniciado por kate moss, Novembro 26, 2024.

  1. kate moss

    kate moss Guest

    I am trying to invoke a function on particular route after page loaded fully, like if user logged in and come to main page route first, and it loaded successfully a function will invoke/call by itself.

    constructor( private router: Router) {
    this.router.events.subscribe((event: Event) => {
    if (event instanceof NavigationEnd) {

    console.log(router.url);
    //function writes here

    }
    });

    }


    I am calling this function on main.ts but when user trying to logged in this function invokes why ?

    Continue reading...

Compartilhe esta Página