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
Post a Comment