@@ -100,8 +100,14 @@ function $RouteProvider() {
100
100
* If all the promises are resolved successfully, the values of the resolved promises are
101
101
* injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is
102
102
* fired. If any of the promises are rejected the
103
- * {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. The map object
104
- * is:
103
+ * {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired.
104
+ * For easier access to the resolved dependencies from the template, the `resolve` map will
105
+ * be available on the scope of the route, under `$resolve` (by default) or a custom name
106
+ * specified by the `resolveAs` property (see below).
107
+ * **Note:** If your scope already contains a property with this name, it will be hidden or
108
+ * overwritten. Make sure, you specify an appropriate name for this property, that
109
+ * does not collide with other properties on the scope.
110
+ * The map object is:
105
111
*
106
112
* - `key` – `{string}`: a name of a dependency to be injected into the controller.
107
113
* - `factory` - `{string|function}`: If `string` then it is an alias for a service.
@@ -111,6 +117,9 @@ function $RouteProvider() {
111
117
* `ngRoute.$routeParams` will still refer to the previous route within these resolve
112
118
* functions. Use `$route.current.params` to access the new route parameters, instead.
113
119
*
120
+ * - `resolveAs` - {string=} - The name under which the `resolve` map will be available on the
121
+ * scope of the route. If omitted, defaults to `$resolve`.
122
+ *
114
123
* - `redirectTo` – {(string|function())=} – value to update
115
124
* {@link ng.$location $location} path with and trigger route redirection.
116
125
*
@@ -260,14 +269,17 @@ function $RouteProvider() {
260
269
* @property {Object } current Reference to the current route definition.
261
270
* The route definition contains:
262
271
*
263
- * - `controller`: The controller constructor as define in route definition.
272
+ * - `controller`: The controller constructor as defined in the route definition.
264
273
* - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for
265
274
* controller instantiation. The `locals` contain
266
275
* the resolved values of the `resolve` map. Additionally the `locals` also contain:
267
276
*
268
277
* - `$scope` - The current route scope.
269
278
* - `$template` - The current route template HTML.
270
279
*
280
+ * The `locals` will be assigned to the route scope's `$resolve` property. You can override
281
+ * the property name, using `resolveAs` in the route definition.
282
+ *
271
283
* @property {Object } routes Object with all route configuration Objects as its properties.
272
284
*
273
285
* @description
0 commit comments