-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
ngOnChanges produces changes for every input, even when the objects are unchanged. #403
Comments
Thanks for reporting this issue! I will investigate what is the cause and fix it soon. |
Okay so after my investigation I figured out that this is a regression in Angular's I'm not sure if this was a change by design or a regression in Angular so I'm going to open an issue there and ask for clarification. After their response we will know how to address this bug but for now I would recommend you to simply do a reference checks in |
During deeper investigation is turns out that Angular's differ works fine and library was using incorrect API to collect changes from it. Currently new records are collected from ng-dynamic-component/projects/ng-dynamic-component/src/lib/io/io.service.ts Lines 241 to 245 in a4dd160
But there is another method So I'm preparing a fix now and will release soon. |
Thanks for your quick investigation and solution! Awesome to see that this package is so well supported. 😊 Will the change also be pushed to the |
## [7.0.2](v7.0.1...v7.0.2) (2020-10-14) ### Bug Fixes * **io:** only add changed inputs to changes in OnChanges hook ([1d8c6c0](1d8c6c0)), closes [#403](#403)
🎉 This issue has been resolved in version 7.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Also it was released on |
Problem:
ngOnChanges
seems to always provide all inputs in the SimpleChanges object, even though some inputs are unchanged. Correct behavior would be that only the changed inputs are provided, similar to the Angular implementation.Repro steps:
val1
button, which changes thesomeValue
property onHelloComponent
.name
should not come up as a change, since it has not changed.My own debugging shows that all bound input properties are always marked as changed. I can work around it for now by checking for equality myself in the
ngOnChanges
method of my component, but a fix would of course be preferable.The text was updated successfully, but these errors were encountered: