You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string.
57
58
*/
58
59
controller?: string|InlineAnnotatedFunction;
@@ -61,56 +62,122 @@ declare module 'angular' {
61
62
*/
62
63
controllerAs?: string;
63
64
/**
64
-
* Undocumented?
65
-
*/
66
-
name?: string;
67
-
/**
68
-
* {string=|function()=}
65
+
* {(string|Function)=}
69
66
* Html template as a string or a function that returns an html template as a string which should be used by ngView or ngInclude directives. This property takes precedence over templateUrl.
70
67
*
71
68
* If template is a function, it will be called with the following parameters:
72
69
*
73
70
* {Array.<Object>} - route parameters extracted from the current $location.path() by applying the current route
* {Object.<string, function>=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is:
87
-
*
88
-
* - key - {string}: a name of a dependency to be injected into the controller.
89
-
* - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead.
83
+
* {Object.<string, Function>=}
84
+
* An optional map of dependencies which should be injected into the controller. If any of these
85
+
* dependencies are promises, the router will wait for them all to be resolved or one to be rejected before
86
+
* the controller is instantiated.
87
+
* If all the promises are resolved successfully, the values of the resolved promises are injected and
88
+
* `$routeChangeSuccess` event is fired. If any of the promises are rejected the `$routeChangeError` event
89
+
* is fired.
90
+
* For easier access to the resolved dependencies from the template, the `resolve` map will be available on
91
+
* the scope of the route, under `$resolve` (by default) or a custom name specified by the `resolveAs`
92
+
* property (see below). This can be particularly useful, when working with components as route templates.
93
+
*
94
+
* > **Note:** If your scope already contains a property with this name, it will be hidden or overwritten.
95
+
* > Make sure, you specify an appropriate name for this property, that does not collide with other
96
+
* > properties on the scope.
97
+
*
98
+
* The map object is:
99
+
*
100
+
* - `key` – `{string}`: a name of a dependency to be injected into the controller.
101
+
* - `factory` - `{string|Function}`: If `string` then it is an alias for a service. Otherwise if function,
102
+
* then it is called with `$injector#invoke()` and the return value is treated as the dependency. If the
103
+
* result is a promise, it is resolved before its value is injected into the controller. Be aware that
104
+
* `ngRoute.$routeParams` will still refer to the previous route within these resolve functions. Use
105
+
* `$route.current.params` to access the new route parameters, instead.
90
106
*/
91
107
resolve?: {[key: string]: any};
92
108
/**
93
-
* {(string|function())=}
94
-
* Value to update $location path with and trigger route redirection.
109
+
* {string=}
110
+
* The name under which the `resolve` map will be available on the scope of the route. If omitted, defaults
111
+
* to `$resolve`.
112
+
*/
113
+
resolveAs?: string;
114
+
/**
115
+
* {(string|Function)=}
116
+
* Value to update `$location` path with and trigger route redirection.
117
+
*
118
+
* If `redirectTo` is a function, it will be called with the following parameters:
119
+
*
120
+
* - `{Object.<string>}` - route parameters extracted from the current `$location.path()` by applying the
121
+
* current route templateUrl.
122
+
* - `{string}` - current `$location.path()`
123
+
* - `{Object}` - current `$location.search()`
124
+
*
125
+
* The custom `redirectTo` function is expected to return a string which will be used to update
126
+
* `$location.url()`. If the function throws an error, no further processing will take place and the
127
+
* `$routeChangeError` event will be fired.
128
+
*
129
+
* Routes that specify `redirectTo` will not have their controllers, template functions or resolves called,
130
+
* the `$location` will be changed to the redirect url and route processing will stop. The exception to this
131
+
* is if the `redirectTo` is a function that returns `undefined`. In this case the route transition occurs
* Reload route when only $location.search() or $location.hash() changes.
164
+
* {boolean=true}
165
+
* Reload route when only `$location.search()` or `$location.hash()` changes.
166
+
*
167
+
* If the option is set to `false` and the URL in the browser changes, then a `$routeUpdate` event is
168
+
* broadcasted on the root scope (without reloading the route).
169
+
*
170
+
* > Note: This option has no effect if `reloadOnUrl` is set to `false`.
106
171
*
107
-
* This option defaults to true. If the option is set to false and url in the browser changes, then $routeUpdate event is broadcasted on the root scope.
172
+
* Defaults to `true`.
108
173
*/
109
174
reloadOnSearch?: boolean;
110
175
/**
111
-
* Match routes without being case sensitive
176
+
* {boolean=false}
177
+
* Match routes without being case sensitive.
178
+
* If the option is set to `true`, then the particular route can be matched without being case sensitive.
112
179
*
113
-
* This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive
0 commit comments