ng4-loading-spinner icon indicating copy to clipboard operation
ng4-loading-spinner copied to clipboard

Spinner is hiding after some time. Its not waiting for hide() method?

Open manojcena opened this issue 6 years ago • 21 comments

I am using 1.2.3 version of the plugin.

Expected Behavior: once i call this.spinnerService.show() showing the loader fine. the loader only hide when i call this.spinnerService.hide().

CurrentBehavior: once i call this.spinnerService.show() showing the loader fine but after 5 seconds its automatically hiding. I need to hide the loader once i call hide() method.

manojcena avatar Jul 28 '18 08:07 manojcena

I've ran into the same issue - Angular 6 tested on 1.1.3 (obviously does not work) then 1.2.0 and 1.2.3 - on both loader hides itself (even though there is no .hide() method invoked).

Done nothing more than imported Ng4LoadingSpinnerModule and added to app.component then .show() from component. Tried also different attributes combinations, but any of them seemed to work.

przemyslawpedziwiatr avatar Jul 31 '18 13:07 przemyslawpedziwiatr

I am just starting to look at this component but according to the docs, this is by design. This parameter will automatically hide the spinner after some time.

[timeout] : Accepts time in milliseconds to hide the spinner automatically. Default is 5000 ms.

I am unsure if this can be disabled but you could just set it to a crazy high number if you never want it to happen. (I personally do not see a use case for this...why would you want to hide the spinner on a long running operation before it finishes...)

JayCallas avatar Aug 01 '18 19:08 JayCallas

@JayCallas temporarily i did that one But i felt that is not the good solution for it. May be they should come up with solution to disable auto hiding after 5000 ms.

manojcena avatar Aug 02 '18 04:08 manojcena

@manojcena @JayCallas Same here...after upgrading project to angular 6. Spinner hiding after some time and its not waiting for hide method

rrahul14 avatar Oct 03 '18 05:10 rrahul14

@manojcena @JayCallas I also faced the same issue. You can try this spinner https://www.npmjs.com/package/ngx-spinner it's working properly with angular 6 and have some other features

rrahul14 avatar Oct 03 '18 05:10 rrahul14

Hi All,

You need to set time [timeout] property in ng-loading-spinner. By default it's 5 seconds.

andynrkri avatar Oct 10 '18 05:10 andynrkri

HI @andynrkri , If I need to dismiss after getting the HTTP response, what should I do? I have a file upload and I need to dismiss only after complete posting. But now it will dismiss before completion. Thanks

akhilsanker avatar Oct 22 '18 07:10 akhilsanker

The default for [timeout] should be 0 which should disable the timeout.

liefersfl avatar Oct 29 '18 08:10 liefersfl

I just came up on this same issue. I've submitted PR #49.

jdhines avatar Nov 19 '18 21:11 jdhines

Add this line in your html file.

<ng4-loading-spinner [timeout]="99000">

credit: @jdhines

SanthoshSiddegowda avatar Nov 11 '19 07:11 SanthoshSiddegowda

ngxspinner.hide() is not working in angular v9. working fine if we keep it in each child component , but if keep it as common in parent component ,the spinner is unable to hide, even though we are calling hide().

venkatramarajup avatar Jun 19 '20 06:06 venkatramarajup

We have same issue, ngxspinner.hide() is not working in angular v9

Paniraj2010 avatar Jun 23 '20 08:06 Paniraj2010

We have same issue, ngxspinner.hide() is not working in angular v9

Is there any alternate solution?

venkatramarajup avatar Jun 23 '20 08:06 venkatramarajup

try with this, if you hide spinner from ngonint() or calling from ngonint() setTimeout(() => this.spinner.show(), 25); It worked for our scenario.

Paniraj2010 avatar Jun 23 '20 08:06 Paniraj2010

try with this, if you hide spinner from ngonint() or calling from ngonint() setTimeout(() => this.spinner.show(), 25); It worked for our scenario.

if we write in ngoninit() it is working , but i want to hide() after subcribing, and show before subscribing , in this case it is not working

venkatramarajup avatar Jun 23 '20 08:06 venkatramarajup

try with this, if you hide spinner from ngonint() or calling from ngonint() setTimeout(() => this.spinner.show(), 25); It worked for our scenario.

if we write in ngoninit() it is working , but i want to hide() after subcribing, and show before subscribing , in this case it is not working

From where are you calling API, not from ngonint?

Paniraj2010 avatar Jun 23 '20 08:06 Paniraj2010

try with this, if you hide spinner from ngonint() or calling from ngonint() setTimeout(() => this.spinner.show(), 25); It worked for our scenario.

if we write in ngoninit() it is working , but i want to hide() after subcribing, and show before subscribing , in this case it is not working

From where are you calling API, not from ngonint?

No,not from ngoninit()

venkatramarajup avatar Jun 23 '20 08:06 venkatramarajup

i am calling the method when button is clicked , at that point of time i am calling ngxspinner.show() , and after subscribed(result=>{this.spinner.hide()} i am calling like. this.spinner.hide() is never hidding until we press some key/button.

venkatramarajup avatar Jun 23 '20 09:06 venkatramarajup

i am calling the method when button is clicked , at that point of time i am calling ngxspinner.show() , and after subscribed(result=>{this.spinner.hide()} i am calling like. this.spinner.hide() is never hidding until we press some key/button.

did you try this setTimeout(() => this.spinner.hide(), 25);

Paniraj2010 avatar Jun 23 '20 09:06 Paniraj2010

i tried it worked while intial loading of the page ,but i want when i click the button

venkatramarajup avatar Jun 23 '20 10:06 venkatramarajup

but, instead of ngx spinner, i changed from this website https://www.angularjswiki.com/angular/creating-progress-spinner-in-angular/ it worked

venkatramarajup avatar Jun 23 '20 10:06 venkatramarajup