Answer the question
In order to leave comments, you need to log in
How to replace Injector.create?
Hello.
I came across the fact that in the last angular Injector.create - depricatet Tell me
how to use this method now and how to replace it?
Here is what he writes: @deprecated from v5 use the new signature Injector.create(options)
What then should I use in my case if I have the following code:
const injector = Injector.create(inputProviders, this.container.parentInjector);
Answer the question
In order to leave comments, you need to log in
use
static create(options: {
providers: StaticProvider[];
parent?: Injector;
name?: string;
}): Injector;
const options = {
providers: inputProviders,
parent: this.container.parentInjector
};
const injector = Injector.create(options);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question