Created
December 15, 2014 15:35
-
-
Save xcarpentier/4c25ab16ec199ebfbe2e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* recommandé */ | |
function handleRoutingErrors() { | |
/** | |
* Annulation de route : | |
* Lors d'une erreur de routing aller au dashboard. | |
* Fournir une clause de sortie si il essaye deux fois. | |
*/ | |
$rootScope.$on('$routeChangeError', | |
function (event, current, previous, rejection) { | |
var destination = (current && (current.title || current.name || current.loadedTemplateUrl)) || | |
'unknown target'; | |
var msg = 'Error routing to ' + destination + '. ' + (rejection.msg || ''); | |
/** | |
* Optionellement logguez en utilisant un service custom ou $log. | |
* (N'oubliez pas d'injecter le service custom) | |
*/ | |
logger.warning(msg, [current]); | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment