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

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

Open
manojcena opened this issue Jul 28, 2018 · 21 comments
Open

Comments

@manojcena
Copy link

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.

@przemyslawpedziwiatr
Copy link

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.

@JayCallas
Copy link

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...)

@manojcena
Copy link
Author

@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.

@rrahul14
Copy link

rrahul14 commented Oct 3, 2018

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

@rrahul14
Copy link

rrahul14 commented Oct 3, 2018

@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

@andynrkri
Copy link

Hi All,

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

@akhilsanker
Copy link

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

@liefersfl
Copy link

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

@jdhines
Copy link
Contributor

jdhines commented Nov 19, 2018

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

@SanthoshSiddegowda
Copy link

Add this line in your html file.

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

credit: @jdhines

@venkatramarajup
Copy link

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().

@Paniraj2010
Copy link

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

@venkatramarajup
Copy link

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

Is there any alternate solution?

@Paniraj2010
Copy link

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

@venkatramarajup
Copy link

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

@Paniraj2010
Copy link

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?

@venkatramarajup
Copy link

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
Copy link

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.

@Paniraj2010
Copy link

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);

@venkatramarajup
Copy link

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

@venkatramarajup
Copy link

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

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