Skip to content

Commit 0011e90

Browse files
Josh Schumacherjamesdaily
Josh Schumacher
authored andcommitted
docs($routeProvider): document route.resolve rejection
Add documentation that the $routeChangeError event is fired when a route resolve promise is rejected Closes angular#4447
1 parent 9567602 commit 0011e90

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ngRoute/route.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,12 @@ function $RouteProvider(){
8989
* `$location.path()` by applying the current route
9090
*
9191
* - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should
92-
* be injected into the controller. If any of these dependencies are promises, they will be
93-
* resolved and converted to a value before the controller is instantiated and the
94-
* `$routeChangeSuccess` event is fired. The map object is:
92+
* be injected into the controller. If any of these dependencies are promises, the router will
93+
* wait for them all to be resolved or one to be rejected before the controller is instantiated.
94+
* If all the promises are resolved successfully, the values of the resolved promises are injected
95+
* and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is fired.
96+
* If any of the promises are rejected the {@link ngRoute.$route#$routeChangeError $routeChangeError}
97+
* event is fired. The map object is:
9598
*
9699
* - `key` – `{string}`: a name of a dependency to be injected into the controller.
97100
* - `factory` - `{string|function}`: If `string` then it is an alias for a service.

0 commit comments

Comments
 (0)