feat(routing): Helpful logging message on unmatched routes

This commit is contained in:
Max Lynch
2014-10-10 21:47:59 -07:00
parent 573fd1a50c
commit ea36d71b77

View File

@@ -1148,6 +1148,9 @@ function $UrlRouterProvider( $urlMatcherFactory) {
for (i=0; i<n; i++) {
if (check(rules[i])) return;
}
if($location.$$path && $location.$$path !== '/') {
console.warn('Routing: No route matched for', $location.$$path + '. Check your Ionic route definitions.');
}
// always check otherwise last to allow dynamic updates to the set of rules
if (otherwise) check(otherwise);
}
@@ -3220,4 +3223,4 @@ function $RouteProvider( $stateProvider, $urlRouterProvider) {
angular.module('ui.router.compat')
.provider('$route', $RouteProvider)
.directive('ngView', $ViewDirective);
})(window, window.angular);
})(window, window.angular);