feat(ivy): require 'token' for ngInjectableDef (#30855)
The compiler generates a 'token' field when it emits an ngInjectableDef, but this field was not required by defineInjectable or the InjectableDef interface, nor was it added by InjectionToken. This commit makes 'token' required and adds it where missing. PR Close #30855
This commit is contained in:

committed by
Andrew Kushnir

parent
b0866769b0
commit
a4b4f35533
@ -10,6 +10,7 @@ import {Injector, ɵcreateInjector as createInjector, ɵɵdefineInjectable, ɵɵ
|
||||
|
||||
export class RootService {
|
||||
static ngInjectableDef = ɵɵdefineInjectable({
|
||||
token: RootService,
|
||||
providedIn: 'root',
|
||||
factory: () => new RootService(),
|
||||
});
|
||||
@ -17,6 +18,7 @@ export class RootService {
|
||||
|
||||
export class ScopedService {
|
||||
static ngInjectableDef = ɵɵdefineInjectable({
|
||||
token: ScopedService,
|
||||
providedIn: null,
|
||||
factory: () => new ScopedService(),
|
||||
});
|
||||
|
Reference in New Issue
Block a user