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

Loader with * identifier already exist when used in popovers #59

Open
Et3rnal opened this issue May 3, 2022 · 0 comments
Open

Loader with * identifier already exist when used in popovers #59

Et3rnal opened this issue May 3, 2022 · 0 comments

Comments

@Et3rnal
Copy link

Et3rnal commented May 3, 2022

Hi,

Using the loader in with something like popover which has static values so it gets removed and add quickly causes the following error
Error: Loader with * identifier already exist

I have tried removing the loader when the popover is destroyed but that doesn't seem to be helping. I need the loader if something gets triggered within the popover so I don't need it as soon as the loader opens.

Is there a way to stop these instals so they happen at different life cycles maybe ? or make sure the previous with the same name is removed first?

To reproduce the issue, create a popover (not sure if modals will cause the same issue) and inside the template which the popover displays add the loader <ngx-smart-loader identifier="popoverLoader">
now add multiple buttons (or any trigger) to open these popovers
open one
then open the second (without closing the first, it closes by itself)
the error is thrown
obviously, if the user closes the popover before opening another there will be no error

popover user is: https://valor-software.com/ngx-bootstrap/#/components/popover?tab=overview

Workaround: 2 ways:
(1)
I placed a boolean to prevent the loader from initialising and set the boolean to true every time before I call star!
<ngx-smart-loader identifier="popoverLoader" *ngIf="isLoaderLoading">
ps: I have tried to set the boolean to true at different lifecycles but that didn't help

(2)
The popover I use has a delay directive, I set that to 1 and that seemed to give the loader enough time to do what it needs to do.

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