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:
@ -80,7 +80,8 @@ export class IterableDiffers {
|
||||
* ```
|
||||
*/
|
||||
static extend(factories: IterableDifferFactory[]): Provider {
|
||||
return new Provider(IterableDiffers, {
|
||||
return {
|
||||
provide: IterableDiffers,
|
||||
useFactory: (parent: IterableDiffers) => {
|
||||
if (isBlank(parent)) {
|
||||
// Typically would occur when calling IterableDiffers.extend inside of dependencies passed
|
||||
@ -92,7 +93,7 @@ export class IterableDiffers {
|
||||
},
|
||||
// Dependency technically isn't optional, but we can provide a better error message this way.
|
||||
deps: [[IterableDiffers, new SkipSelfMetadata(), new OptionalMetadata()]]
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
find(iterable: any): IterableDifferFactory {
|
||||
|
@ -70,7 +70,8 @@ export class KeyValueDiffers {
|
||||
* ```
|
||||
*/
|
||||
static extend(factories: KeyValueDifferFactory[]): Provider {
|
||||
return new Provider(KeyValueDiffers, {
|
||||
return {
|
||||
provide: KeyValueDiffers,
|
||||
useFactory: (parent: KeyValueDiffers) => {
|
||||
if (isBlank(parent)) {
|
||||
// Typically would occur when calling KeyValueDiffers.extend inside of dependencies passed
|
||||
@ -82,7 +83,7 @@ export class KeyValueDiffers {
|
||||
},
|
||||
// Dependency technically isn't optional, but we can provide a better error message this way.
|
||||
deps: [[KeyValueDiffers, new SkipSelfMetadata(), new OptionalMetadata()]]
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
find(kv: Object): KeyValueDifferFactory {
|
||||
|
Reference in New Issue
Block a user