Skip to content
New issue

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

Host component's ngOnChanges is not called when testing directive using createDirectiveFactory #658

Open
th0r opened this issue Jun 4, 2024 · 0 comments

Comments

@th0r
Copy link
Contributor

th0r commented Jun 4, 2024

Is this a regression?

Yes

Description

When testing directive using createDirectiveFactory and providing custom host component it's ngOnChanges hook is not called neither during component initialization, not after updating its inputs via setHostInput method.

It worked as expected in v14, v15 and v16 and became broken starting from v17.

I've created a reproduction repo and added a single unit test there, so just run npm run test to see the issue.

Please provide a link to a minimal reproduction of the bug

https://github.com/th0r/ngneat-spectator-onchanges-bug

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

Angular CLI: 17.3.8
Node: 20.13.1
Package Manager: npm 10.8.1
OS: darwin arm64

Angular: 17.3.10
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.8
@angular-devkit/build-angular   17.3.8
@angular-devkit/core            17.3.8
@angular-devkit/schematics      17.3.8
@angular/cli                    17.3.8
@schematics/angular             17.3.8
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.6

Anything else?

No response

Do you want to create a pull request?

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant