From 79671a6f127eeb1b7b53378bfbf09db64dd49394 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Wed, 2 Nov 2016 20:33:55 +0000 Subject: [PATCH] refactor(upgrade): add missing Angular 1 type info --- modules/@angular/upgrade/src/angular_js.ts | 3 +++ modules/@angular/upgrade/src/upgrade_adapter.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/@angular/upgrade/src/angular_js.ts b/modules/@angular/upgrade/src/angular_js.ts index caaae5ba7a..a9bf40a8d0 100644 --- a/modules/@angular/upgrade/src/angular_js.ts +++ b/modules/@angular/upgrade/src/angular_js.ts @@ -23,6 +23,7 @@ export interface IModule { controller(name: string, type: IInjectable): IModule; factory(key: Ng1Token, factoryFn: IInjectable): IModule; value(key: Ng1Token, value: any): IModule; + constant(token: Ng1Token, value: any): IModule; run(a: IInjectable): IModule; } export interface ICompileService { @@ -42,6 +43,7 @@ export interface IRootScopeService { $parent: IScope; $root: IScope; $watch(expr: any, fn?: (a1?: any, a2?: any) => void): Function; + $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function; $destroy(): any; $apply(): any; $apply(exp: string): any; @@ -118,6 +120,7 @@ export type IAugmentedJQuery = Node[] & { append?: (content: IAugmentedJQuery | string) => IAugmentedJQuery; controller?: (name: string) => any; isolateScope?: () => IScope; + injector?: () => IInjectorService; }; export interface IProvider { $get: IInjectable; } export interface IProvideService { diff --git a/modules/@angular/upgrade/src/upgrade_adapter.ts b/modules/@angular/upgrade/src/upgrade_adapter.ts index a488d9ca28..7d9a8a83ea 100644 --- a/modules/@angular/upgrade/src/upgrade_adapter.ts +++ b/modules/@angular/upgrade/src/upgrade_adapter.ts @@ -333,7 +333,7 @@ export class UpgradeAdapter { .value(NG2_COMPONENT_FACTORY_REF_MAP, componentFactoryRefMap) .config([ '$provide', '$injector', - (provide: any /** TODO #???? */, ng1Injector: angular.IInjectorService) => { + (provide: angular.IProvideService, ng1Injector: angular.IInjectorService) => { provide.decorator(NG1_ROOT_SCOPE, [ '$delegate', function(rootScopeDelegate: angular.IRootScopeService) {