We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With this example :
const TOKEN = new InjectionToken(); @Component({ ... providers: [{ provide: TOKEN, useValue: true }] }) export class MainComponent { constructor(@Inject(TOKEN) isTrue) {} } @NgModule({ declarations: [MainComponent], providers: [{ provide: TOKEN, useValue: false }] })
When running :
const [component] = workspace.getAllComponents(); const [token] = component.getDependencies();
The value token should reference the provider inside the component (with the value true). Current behavior: returns undefined.
token
true
ProviderRegistry
providedIn: 'root'
Hopefully there is a built-in solution in the angular compiler so we can stop at step 1 🤞
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The problem
With this example :
When running :
The value
token
should reference the provider inside the component (with the valuetrue
).Current behavior: returns undefined.
How to solve :
ProviderRegistry
that keeps track of all the provider per class declaration or at the root ifprovidedIn: 'root'
ProviderRegistry
.Hopefully there is a built-in solution in the angular compiler so we can stop at step 1 🤞
The text was updated successfully, but these errors were encountered: