-
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
How to use beforeChange in real live #375
Comments
That is odd. I poked around at the demo and it happens without the I think it's a bug. |
There's definitely a race condition or problem with disabling the switch during the |
Do you have specifics on your use case? Are you sending multiple switch values to a backend at the same time and waiting for them? |
Hello I need help here as I am not able to handle the beforeChange event. I want to show confirm modal when switch is toggle and I have used NgbModal for modal but function is not waiting to get finished as Promise is not working inside observable. HTML
Code
But nothing working for me. checkBefore: Observable = new Observable((observer) => {
}); |
Hello
I have some issue with the beforeChange observable. It works perfect with the sample, but I have strange behavior in a "real life".
Here is very ugly sample for the demo, it emulates htppClient behavior by using of(). The idea behind is to make a call to the server and depends on the result allow or disallow change:
https://stackblitz.com/edit/ngx-ui-switch-fuojps?file=src%2Fapp%2Fdemo%2Fdemo.component.html
Take a look on the console: the onBeforeChange called many times even for not related items:
Is this a bug or expected?
The text was updated successfully, but these errors were encountered: