mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Update angular.d.ts
If splitting the config into seperate files, this constructor overload is useful. For example, you might need a RoutesConfig.ts file.
#### Example
##### RoutesConfig.ts
```
export class RoutesConfig {
static $inject = ['$stateProvider', '$urlRouterProvider', '$locationProvider'];
constructor (private $stateProvider: angular.ui.IStateProvider, private $urlRouterProvider: angular.ui.IUrlRouterProvider, private $locationProvider: ng.ILocationProvider) {
// Unmatched URLs, redirect to root
$urlRouterProvider.otherwise('/block');
$stateProvider
.state('home', {
url: '/',
template: '<route-home></route-home>'
});
$locationProvider.html5Mode(true);
}
}
```
##### Main.ts
```
import {RoutesConfig} from './common/RoutesConfig';
angular.module('myApp', [])
.config(RoutesConfig)
```
This commit is contained in:
Vendored
+1
@@ -200,6 +200,7 @@ declare module angular {
|
||||
* @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration.
|
||||
*/
|
||||
config(inlineAnnotatedFunction: any[]): IModule;
|
||||
config(object: Object): IModule;
|
||||
/**
|
||||
* Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user