@angular/core#AbstractType TypeScript Examples

The following examples show how to use @angular/core#AbstractType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: angular-context.ts    From s-libs with MIT License 5 votes vote down vote up
/**
   * Gets a service or other injectable from the root injector. This implementation is a simple pass-through to [TestBed.inject()]{@linkcode https://angular.io/api/core/testing/TestBed#inject}, but subclasses may provide their own implementation. It is recommended to use this in your tests instead of using `TestBed` directly.
   */
  inject<T>(token: AbstractType<T> | InjectionToken<T> | Type<T>): T {
    return TestBed.inject(token);
  }