Created
May 29, 2018 21:46
-
-
Save jsanta/c519c3c5bf0911c66251bbdb86ce9fb4 to your computer and use it in GitHub Desktop.
UIRouter Config with hooks (based on Angular UI Router Sample App)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** UIRouter Config */ | |
export function uiRouterConfigFn(router: UIRouter, injector: Injector) { | |
// If no URL matches, go to the `login` state by default | |
router.urlService.rules.otherwise({ | |
state: 'login' | |
}); | |
const transitionService = router.transitionService; | |
requiresAuthHook(transitionService); | |
requiresEnabledHook(transitionService); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment