Skip to content

Instantly share code, notes, and snippets.

@kalisjoshua
Created January 31, 2014 22:38
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 kalisjoshua/8744702 to your computer and use it in GitHub Desktop.
Save kalisjoshua/8744702 to your computer and use it in GitHub Desktop.
// Async Before App Init
angular.module('app', [/*...*/])
.config(function () {
// register all routes and stuff
})
.run(function ($rootScope) {
$rootScope.$on('$stateChangeStart', function (AsyncValue) {
if (!AsyncValue.pageAvailable) {
// send back to home
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment