Skip to content

Instantly share code, notes, and snippets.

@jsanta
Created May 29, 2018 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsanta/c519c3c5bf0911c66251bbdb86ce9fb4 to your computer and use it in GitHub Desktop.
Save jsanta/c519c3c5bf0911c66251bbdb86ce9fb4 to your computer and use it in GitHub Desktop.
UIRouter Config with hooks (based on Angular UI Router Sample App)
/** 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