Leverage the power

of Angular Routing

Routing

World Wide Web

Power of Routing

  • You know where to start and to end
  • You know what's in between

Key benefits

"PREDICTABLE" STATES

EASIER TO TEST

if(user.click) {
    disableComp1();
    disableComp2();
    showComp5();
    showComp4();
} 


websocket$.subscribe( () => {
     showComp3();
})
if(url === 'is-super-man') {
    assert('something');
}
import { Router, NavigationStart, 
Event as NavigationEvent } 
from '@angular/router';

constructor(router:Router) {
  router.events.forEach((event: NavigationEvent) => {
    if(event instanceof NavigationStart) {
    }
    // NavigationEnd
    // NavigationCancel
    // NavigationError
    // RoutesRecognized
  });
}

DEMO

Leverage the power of Angular Routing

By tlimpanont

Leverage the power of Angular Routing

  • 316