mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(routing): Helpful logging message on unmatched routes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user