Routing
Router maps URL → component. { path: 'marks', component: MarksPage }. routerLink="/marks" changes the URL without a full reload. <a href="/marks"> reloads and kills in-memory state.
router-outlet is where the child page paints. Params: /marks/:roll → ActivatedRoute.snapshot.paramMap.get('roll'). Guard CanActivate blocks /admin if not logged in.
Trap — wrong path order — '**' wildcard must be last. Another trap: forgetting RouterModule.forRoot in the root import.
/login → LoginPage /marks → MarksPage /admin + CanActivate ** → NotFound (last)
Exam tip
routerLink vs href. One param + one guard line.