Skip to content

Commit

Permalink
chore(di): Remove static method InjectorService.invokeMethod
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Remove static method InjectorService.invokeMethod. Create a new instance of InjectorService and use injector.invokeMethod instead of.
  • Loading branch information
Romakita committed Dec 23, 2018
1 parent 17679c3 commit f75bd75
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions packages/di/src/services/InjectorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,43 +564,6 @@ export class InjectorService extends Map<RegistryKey, Provider<any>> {
): T {
return globalInjector.invoke(target, locals, designParamTypes, requiredScope);
}

/**
* Invoke a class method and inject service.
*
* #### IInjectableMethod options
*
* * **target**: Optional. The class instance.
* * **methodName**: `string` Optional. The method name.
* * **designParamTypes**: `any[]` Optional. List of injectable types.
* * **locals**: `Map<Function, any>` Optional. If preset then any argument Class are read from this object first, before the `InjectorService` is consulted.
*
* #### Example
*
* ```typescript
* import {InjectorService} from "@tsed/common";
*
* class MyService {
* constructor(injectorService: InjectorService) {
* injectorService.invokeMethod(this.method.bind(this), {
* target: this,
* methodName: 'method'
* });
* }
*
* method(otherService: OtherService) {}
* }
* ```
*
* @returns {any}
* @param handler The injectable method to invoke. Method parameters are injected according method signature.
* @param options Object to configure the invocation.
*/
@Deprecated("removed feature")
/* istanbul ignore next */
static invokeMethod(handler: any, options: IInjectableMethod<any> | any[]) {
return globalInjector.invokeMethod(handler, options);
}
}

/**
Expand Down

0 comments on commit f75bd75

Please sign in to comment.