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
I have a use case where a directive makes use of a service. However, I can not figure out how to set this up with createHostComponentFactory.
createHostComponentFactory
I've used AppUnlessDirective from the Angular docs as an example.
AppUnlessDirective
const createHost = createHostComponentFactory({ component: AppUnlessDirective, providers: [AppUnlessService] });
Giving the following error (because it's a directive and not a component?)
TypeError: Cannot read property 'componentInstance' of null
https://stackblitz.com/edit/spectator-directive-providers?file=app%2Fapp-unless.directive.spec.ts
The text was updated successfully, but these errors were encountered:
I see where is the problem, let me investigate.
Sorry, something went wrong.
It's not related to the service, it's related to the structural directive.
Fixed in 1.4.4
https://stackblitz.com/edit/spectator-structural-directive-y16jdw?file=app/app-unless.directive.spec.ts
Thanks!
No branches or pull requests
Problem
I have a use case where a directive makes use of a service.
However, I can not figure out how to set this up with
createHostComponentFactory
.Giving the following error (because it's a directive and not a component?)
Example code
https://stackblitz.com/edit/spectator-directive-providers?file=app%2Fapp-unless.directive.spec.ts
The text was updated successfully, but these errors were encountered: