From c6ab786741001862e0c80f610b4a2b12dbb763d1 Mon Sep 17 00:00:00 2001 From: romiem Date: Tue, 2 Feb 2016 16:22:59 +0000 Subject: [PATCH] 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: '' }); $locationProvider.html5Mode(true); } } ``` ##### Main.ts ``` import {RoutesConfig} from './common/RoutesConfig'; angular.module('myApp', []) .config(RoutesConfig) ``` --- angularjs/angular.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index d1197dec1..4d5ed56d9 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -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. *