Angular detect if the page is changed

import { NavigationEnd, Router } from '@angular/router';

    this._router.events.subscribe((event) => {
      if(event instanceof NavigationEnd) {
         console.log(event);
         if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){

          this.sidebarStatus = true;
          this._headerService.toggleSidebarNav(this.sidebarStatus);
        }
         
      }
  });
Published
Categorized as Angular

By Santosh Kumar Shah

I am JavaScript developer.

Leave a comment

Your email address will not be published. Required fields are marked *