refactor(Provider): remove deprecated provider/bind API (#10652)

Closes #9751

BREAKING CHANGE:

These forms of providers are no longer accepted:
  bind(MyClass).toFactory(...)
  new Provider(MyClass, toFactory: ...)

We now only accept:
  {provider: MyClass, toFactory: ...}
This commit is contained in:
Miško Hevery
2016-08-15 19:37:42 -07:00
committed by vikerman
parent 04c11bb749
commit bec5c5fdad
47 changed files with 497 additions and 639 deletions

View File

@ -720,3 +720,30 @@ export interface StaticSymbol {
name: string;
filePath: string;
}
export class ProviderMeta {
token: any;
useClass: Type<any>;
useValue: any;
useExisting: any;
useFactory: Function;
dependencies: Object[];
multi: boolean;
constructor(token: any, {useClass, useValue, useExisting, useFactory, deps, multi}: {
useClass?: Type<any>,
useValue?: any,
useExisting?: any,
useFactory?: Function,
deps?: Object[],
multi?: boolean
}) {
this.token = token;
this.useClass = useClass;
this.useValue = useValue;
this.useExisting = useExisting;
this.useFactory = useFactory;
this.dependencies = deps;
this.multi = !!multi;
}
}