This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
feat: warn when passing a string to $routeProvider.otherwise() #7794
Closed
Description
In your route configuration, it's easy to accidentally write:
$routeProvider.otherwise('/');
Thinking that it will behave like:
$routeProvider.otherwise({ redirectTo: '/' });
What will actually happen is that the app's routing will have no otherwise behavior.
$routeProvider.otherwise
should either throw an error, or alias the string as the redirectTo
property of the configuration. I have a slight preference towards a string parameter be the same as redirectTo
.
Thoughts? @caitp @matsko @IgorMinar