diff --git a/generated/browser/js/app.js b/generated/browser/js/app.js index f8a5c0b..a5de5cb 100644 --- a/generated/browser/js/app.js +++ b/generated/browser/js/app.js @@ -12,6 +12,14 @@ app.config(function ($urlRouterProvider, $locationProvider) { }); }); +// This app.run is for listening to errors broadcasted by ui-router, usually originating from resolves +app.run(function ($rootScope) { + $rootScope.$on('$stateChangeError', function (event, toState, toParams, fromState, fromParams, thrownError) { + console.info(`The following error was thrown by ui-router while transitioning to state "${toState.name}". The origin of this error is probably a resolve function:`); + console.error(thrownError); + }); +}); + // This app.run is for controlling access to specific states. app.run(function ($rootScope, AuthService, $state) {