canActivate
and canDeactivate
functions for route segments:canActivate
functions are called on segments which will become active as a result of a route changecanDeactivate
functions are called on segments which will become inactive as a result of a route changedone(err, result)
).canActivate
functions are called from top to bottom on newly activated segments. canDeactivate
methods are invoked from bottom to top.