@types/angular-route
Advanced tools
Comparing version 1.3.5 to 1.7.0
@@ -1,4 +0,5 @@ | ||
// Type definitions for Angular JS (ngRoute module) 1.3 | ||
// Type definitions for Angular JS (ngRoute module) 1.7 | ||
// Project: http://angularjs.org | ||
// Definitions by: Jonathan Park <https://github.com/park9140> | ||
// George Kalpakas <https://github.com/gkalpak> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -55,3 +56,3 @@ // TypeScript Version: 2.3 | ||
/** | ||
* {(string|function()=} | ||
* {(string|Function)=} | ||
* Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string. | ||
@@ -65,7 +66,3 @@ */ | ||
/** | ||
* Undocumented? | ||
*/ | ||
name?: string; | ||
/** | ||
* {string=|function()=} | ||
* {(string|Function)=} | ||
* 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. | ||
@@ -77,5 +74,5 @@ * | ||
*/ | ||
template?: string | { ($routeParams?: angular.route.IRouteParamsService): string; } | ||
template?: string | { ($routeParams?: IRouteParamsService): string; } | ||
/** | ||
* {string=|function()=} | ||
* {(string|Function)=} | ||
* Path or function that returns a path to an html template that should be used by ngView. | ||
@@ -87,32 +84,102 @@ * | ||
*/ | ||
templateUrl?: string | { ($routeParams?: angular.route.IRouteParamsService): string; } | ||
templateUrl?: string | { ($routeParams?: IRouteParamsService): string; } | ||
/** | ||
* {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: | ||
* {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. | ||
* For easier access to the resolved dependencies from the template, the `resolve` map will be available on | ||
* the scope of the route, under `$resolve` (by default) or a custom name specified by the `resolveAs` | ||
* property (see below). This can be particularly useful, when working with components as route templates. | ||
* | ||
* - key - {string}: a name of a dependency to be injected into the controller. | ||
* - 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. | ||
* > **Note:** If your scope already contains a property with this name, it will be hidden or overwritten. | ||
* > Make sure, you specify an appropriate name for this property, that does not collide with other | ||
* > properties on the scope. | ||
* | ||
* The map object is: | ||
* | ||
* - `key` – `{string}`: a name of a dependency to be injected into the controller. | ||
* - `factory` - `{string|Function}`: If `string` then it is an alias for a service. Otherwise if function, | ||
* then it is called with `$injector#invoke()` 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. | ||
*/ | ||
resolve?: { [key: string]: any }; | ||
/** | ||
* {(string|function())=} | ||
* Value to update $location path with and trigger route redirection. | ||
* {string=} | ||
* The name under which the `resolve` map will be available on the scope of the route. If omitted, defaults | ||
* to `$resolve`. | ||
*/ | ||
resolveAs?: string; | ||
/** | ||
* {(string|Function)=} | ||
* Value to update `$location` path with and trigger route redirection. | ||
* | ||
* If redirectTo is a function, it will be called with the following parameters: | ||
* If `redirectTo` is a function, it will be called with the following parameters: | ||
* | ||
* - {Object.<string>} - route parameters extracted from the current $location.path() by applying the current route templateUrl. | ||
* - {string} - current $location.path() | ||
* - {Object} - current $location.search() | ||
* - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search(). | ||
* - `{Object.<string>}` - route parameters extracted from the current `$location.path()` by applying the | ||
* current route templateUrl. | ||
* - `{string}` - current `$location.path()` | ||
* - `{Object}` - current `$location.search()` | ||
* | ||
* The custom `redirectTo` function is expected to return a string which will be used to update | ||
* `$location.url()`. If the function throws an error, no further processing will take place and the | ||
* `$routeChangeError` event will be fired. | ||
* | ||
* Routes that specify `redirectTo` will not have their controllers, template functions or resolves called, | ||
* the `$location` will be changed to the redirect url and route processing will stop. The exception to this | ||
* is if the `redirectTo` is a function that returns `undefined`. In this case the route transition occurs | ||
* as though there was no redirection. | ||
*/ | ||
redirectTo?: string | { ($routeParams?: angular.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any): string }; | ||
redirectTo?: string | { ($routeParams?: IRouteParamsService, $locationPath?: string, $locationSearch?: any): string }; | ||
/** | ||
* Reload route when only $location.search() or $location.hash() changes. | ||
* {Function=} | ||
* A function that will (eventually) return the value to update `$location` URL with and trigger route | ||
* redirection. In contrast to `redirectTo`, dependencies can be injected into `resolveRedirectTo` and the | ||
* return value can be either a string or a promise that will be resolved to a string. | ||
* | ||
* 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. | ||
* Similar to `redirectTo`, if the return value is `undefined` (or a promise that gets resolved to | ||
* `undefined`), no redirection takes place and the route transition occurs as though there was no | ||
* redirection. | ||
* | ||
* If the function throws an error or the returned promise gets rejected, no further processing will take | ||
* place and the `$routeChangeError` event will be fired. | ||
* | ||
* `redirectTo` takes precedence over `resolveRedirectTo`, so specifying both on the same route definition, | ||
* will cause the latter to be ignored. | ||
*/ | ||
resolveRedirectTo?: angular.Injectable<(...deps: any[]) => angular.IPromise<string | undefined> | string | undefined>; | ||
/** | ||
* {boolean=true} | ||
* Reload route when any part of the URL changes (including the path) even if the new URL maps to the same | ||
* route. | ||
* | ||
* If the option is set to `false` and the URL in the browser changes, but the new URL maps to the same | ||
* route, then a `$routeUpdate` event is broadcasted on the root scope (without reloading the route). | ||
* | ||
* Defaults to `true`. | ||
*/ | ||
reloadOnUrl?: boolean; | ||
/** | ||
* {boolean=true} | ||
* Reload route when only `$location.search()` or `$location.hash()` changes. | ||
* | ||
* If the option is set to `false` and the URL in the browser changes, then a `$routeUpdate` event is | ||
* broadcasted on the root scope (without reloading the route). | ||
* | ||
* > Note: This option has no effect if `reloadOnUrl` is set to `false`. | ||
* | ||
* Defaults to `true`. | ||
*/ | ||
reloadOnSearch?: boolean; | ||
/** | ||
* Match routes without being case sensitive | ||
* {boolean=false} | ||
* Match routes without being case sensitive. | ||
* If the option is set to `true`, then the particular route can be matched without being case sensitive. | ||
* | ||
* This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive | ||
* Defaults to `false`. | ||
*/ | ||
@@ -119,0 +186,0 @@ caseInsensitiveMatch?: boolean; |
{ | ||
"name": "@types/angular-route", | ||
"version": "1.3.5", | ||
"version": "1.7.0", | ||
"description": "TypeScript definitions for Angular JS (ngRoute module)", | ||
@@ -11,2 +11,7 @@ "license": "MIT", | ||
"githubUsername": "park9140" | ||
}, | ||
{ | ||
"name": "George Kalpakas", | ||
"url": "https://github.com/gkalpak", | ||
"githubUsername": "gkalpak" | ||
} | ||
@@ -17,3 +22,3 @@ ], | ||
"type": "git", | ||
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
}, | ||
@@ -24,4 +29,4 @@ "scripts": {}, | ||
}, | ||
"typesPublisherContentHash": "de336df650cad9cee5687f951ad35697de3a3b05d6c236025469cb76a44164f2", | ||
"typesPublisherContentHash": "2d4322b6c69d51cc091b7f64dc941d42a243d0b3ddfe6f214aff6d4e5ca962f4", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -8,6 +8,6 @@ # Installation | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/angular-route | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/angular-route | ||
Additional Details | ||
* Last updated: Thu, 15 Mar 2018 23:17:55 GMT | ||
* Last updated: Sat, 28 Jul 2018 00:44:17 GMT | ||
* Dependencies: angular | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Jonathan Park <https://github.com/park9140>. | ||
These definitions were written by Jonathan Park <https://github.com/park9140>, George Kalpakas <https://github.com/gkalpak>. |
15055
214