checkEvents() {
        this.router.events.subscribe(event => {
          switch (true) {
            case event instanceof eventName:
              break;
            default:
              break;
          }
        });
      }
      Typescript language logo
      your recipe card header background

      Angular Router Events

      0

      0

      avatar
      Jose Romero
      Angular TypeScript Recipes

      The code defines a function called checkEvents. Within this function, the code subscribes to the events property on the router object. This property contains events that are raised by the browser.

      When an event is raised, the code checks to see if the event instance is the eventName object. If it is, the code breaks out of the function. If it is not, the code simply breaks out of the function.

      Library: angular

      Shortcut: angular.router.events

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.