Skip to content

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

Open
@Et3rnal

Description

@Et3rnal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions