175c79d1d8
This commit replaces the old and slow `ReflectiveInjector` that was deprecated in v5 with the new `Injector`. Note: This change was only done in the spec files inside the `aio` folder. While changing this, it was not possible to directly use `Injector.get` to get the correct typing for the mocked classes. For example: ```typescript locationService = injector.get<TestLocationService>(LocationService); ``` Fails with: > Argument of type 'typeof LocationService' is not assignable to parameter of type 'Type<TestLocationService> | InjectionToken<TestLocationService> | AbstractType<TestLocationService>'. Type 'typeof LocationService' is not assignable to type 'Type<TestLocationService>'. Property 'searchResult' is missing in type 'LocationService' but required in type 'TestLocationService'. Therefore, it was necessary to first convert to `unknown` and then to `TestLocationService`. ```typescript locationService = injector.get(LocationService) as unknown as TestLocationService; ``` PR Close #38408 |
||
---|---|---|
.. | ||
app | ||
assets | ||
environments | ||
extra-files | ||
styles | ||
testing | ||
404-body.html | ||
google385281288605d160.html | ||
index.html | ||
main.ts | ||
noop-worker-basic.js | ||
polyfills.ts | ||
pwa-manifest.json | ||
test.ts |