We have several routes in our app which are not supposed to be navigated by the user by directly entering their URLs into the browser’s address bar.
Instead we only want to make them accessible when we programmatically navigate using router.navigate()
through our application logic.
Using Angular’s CanActivate
guard, is there some flag or attribute which we could use to distinguish between those two cases:
Route is being accessed directly as the user typed
/no/direct/access
into the address barRoute is being accessed via
router.navigate(['/', 'no', 'direct', 'access'])
(which might in turn be triggered by a different guard, sorouter.navigated
unfortunately doesn’t seem to help here)