Skip to content

Commit

Permalink
chore(di): Remove static method InjectorService.has
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Remove static method InjectorService.has. Create a new instance of InjectorService and use injector.has instead of.
  • Loading branch information
Romakita committed Dec 23, 2018
1 parent 37b1de8 commit 628e455
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions packages/di/src/services/InjectorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,31 +624,6 @@ export class InjectorService extends Map<RegistryKey, Provider<any>> {

return InjectorService;
}

/**
* Check if the service of factory exists in `InjectorService`.
*
* #### Example
*
* ```typescript
* import {InjectorService} from "@tsed/common";
* import MyService from "./services";
*
* class OtherService {
* constructor(injectorService: InjectorService) {
* const exists = injectorService.has(MyService); // true or false
* }
* }
* ```
*
* @param target The service class
* @returns {boolean}
*/
@Deprecated("static InjectorService.has(). Removed feature.")
/* istanbul ignore next */
static has(target: any): boolean {
return globalInjector.has(target);
}
}

/**
Expand Down

0 comments on commit 628e455

Please sign in to comment.