-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The following code reproduce SomeComponent is not injectable. Because design:paramtypes metadata is stripped by Angular during production build.
import {Dilight, Injectable, Module, Injector} from 'dilight';
@Injectable()
class ServiceA {}
@Injectable()
class ServiceB {
constructor(private a: ServiceA) {}
}
@Module({
providers: [ServiceB],
})
class SomeComponent {
constructor(public childInjector: Injector) {}
}
const parentInjector = Dilight.new();
const comp = parentInjector.get(SomeComponent);
// will log false
console.log(comp.childInjector.get(ServiceB) === parentInjector.get(ServiceB));
// will log true
console.log(comp.childInjector.get(ServiceA) === parentInjector.get(ServiceA));Metadata
Metadata
Assignees
Labels
No labels