diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index b11b87634..04ea58f4a 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -1041,3 +1041,18 @@ function parseTyping() { return compiledExp({}, {a: {b: {c: 42}}}); } } + +function doBootstrap(element: Element | JQuery, mode: string): ng.auto.IInjectorService { + if (mode === 'debug') { + return angular.bootstrap(element, ['main', function($provide: ng.auto.IProvideService) { + $provide.decorator('$rootScope', function($delegate: ng.IRootScopeService) { + $delegate['debug'] = true; + }); + }, 'debug-helpers'], { + debugInfoEnabled: true + }); + } + return angular.bootstrap(element, ['main'], { + debugInfoEnabled: false + }); +} diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index b8d5d27bf..12aca1dc0 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -41,6 +41,7 @@ declare module angular { interface IAngularBootstrapConfig { strictDi?: boolean; + debugInfoEnabled?: boolean; } /////////////////////////////////////////////////////////////////////////// @@ -56,132 +57,11 @@ declare module angular { * @param element DOM element which is the root of angular application. * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. + * function that will be invoked by the injector as a config block. * @param config an object for defining configuration options for the application. The following keys are supported: * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: string, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: string, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: string, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: JQuery, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: JQuery, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: JQuery, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Element, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Element, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Element, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Document, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Document, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Document, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; + bootstrap(element: string|Element|JQuery, modules?: (string|Function|any[])[], config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Creates a deep copy of source, which should be an object or an array. @@ -674,7 +554,7 @@ declare module angular { */ $odd: boolean; - } + } interface IAngularEvent { /**