angular - Angular2 conditional routing -


this might basic question, in angular2 there way conditional routing ? or, outside router ?

i know ui-router had ability this, haven't seen similar in angular2s router

update

in new router guards can used instead https://angular.io/docs/ts/latest/guide/router.html#!#guards

original (for long gone router)

implement canactivate lifecycle hook shown here life cycle hooks in angular2 router , return false if want prevent navigation. see https://angular.io/docs/ts/latest/api/router/canactivate-var.html


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -