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:
romiem
2016-02-02 16:22:59 +00:00
parent e69fe60f2d
commit c6ab786741
+1
View File
@@ -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.
*