0
0
JRJose Romero
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
checkEvents() {
this.router.events.subscribe(event => {
switch (true) {
case event instanceof eventName:
break;
default:
break;
}
});
}