injectFromFixture<T> function

T injectFromFixture<T>(
  1. NgTestFixture<void> fixture,
  2. Object tokenOrType
)

Inject a service for tokenOrType from fixture.

This is for compatibility reasons only and should not be used otherwise.

Implementation

T injectFromFixture<T>(NgTestFixture<void> fixture, Object tokenOrType) {
  return fixture._rootComponentRef.injector.get(tokenOrType) as T;
}