-
Notifications
You must be signed in to change notification settings - Fork 68
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
ngModelChange is being triggered on initial load #457
Comments
I don’t remember exactly. It might have been to set the initial value from ngModel on component init. |
That probably makes sense to set an initial value but it causes some issues with side-effects being called even if a value haven't been changed. |
Also experiencing the same problem. |
I'm using this component to invoke an API based on the For Example, I have a settings page where toggling the |
Any update on this? If you are calling an API on this load event, it can cause pretty wild issues. Any work arounds anyone has come up with? |
Not sure. I might revert the change in the commit mentioned in the first comment. |
Hi @cmckni3, Are you planning to revert the changes becuase of which this intial load issue is appearing? I have used this package in my project and recently updated the version as well. Now I have to handle this inital load by adding some extra code. Let us know. |
Hi. First of all - thank you for the library.
After update from version 10 to 12 I noticed that ngModelChange is triggered right after the ui-switch component appears on a page.
It seems to be related to the commit 1382bb1
Could you please explain what was the fix about? Is it supposed to convert incoming non-boolean value into a boolean?
The issue example: https://stackblitz.com/edit/ngx-ui-switch-kz2sgk
alert is called right after the page init.
The text was updated successfully, but these errors were encountered: