Route guards to funkcje kontrolujące czy nawigacja do/z trasy jest dozwolona. Uruchamiają się przed aktywacją trasy (lub przed jej opuszczeniem), umożliwiając kontrolę uwierzytelniania, kontrolę uprawnień i prompty "niezapisane zmiany".
Dlaczego to ważne
CanActivate → can the user enter this route? (auth/permission check)
CanActivateChild → same, for child routes
CanDeactivate → can the user LEAVE? ("you have unsaved changes")
CanMatch → should this route even be matched? (feature flags, role-based)
resolve → pre-fetch data BEFORE the route activates
