angular - Preventing direct access to a route -


the angular docs nice, can bit overwhelming, maybe missed this, i'm trying figure out how prevent direct access route.

for example, have login route. have canactivate guard on it, working fine now, when goes directly /login route, loads fine; canactivate seems prevent navigating route via routerlink.

how can best prevent access routes overall? obviously, can add code oninit functions of component, that's lot of duplicate code (between guards, resolves, , inits). considered using resolves, though don't know when fire, , can't see way make component specific resolves, mean number of resolves being created.

any advice?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -