1

I created a web page in Angular, divided in various components (tables, lists, etc which receive data from a server). For each element I created a separated class to manage their single spinners (ngx-spinner) so that each spinner ends when the component receives its data.

I managed to have a spinner for each element, however as soon as any element receives its data and its spinner hides, it hides also all the other spinners (even if they didn't receive their data yet).

I declared and managed every ngx-spinner in their own class (and in the main class I simply defined it) using spinner.show/spinner.hide and a declaration like this:

<ngx-spinner [fullScreen]="false" type="ball-clip-rotate" size="medium" bdColor="rgba(51,51,51,0.5)>

Do you know why does this happen? I would like to have many spinners that close only when the data for the spinner's component has been received.

Victor
  • 3,669
  • 3
  • 37
  • 42
  • Looks like you maintaining one variable to show/hide spinner. Use different variable to manage based on the response. – Shabbir Dhangot Jun 22 '20 at 11:05
  • I tried to use different variables but it won't help. I define the spinner in my constructor like this: constructor( public restService: RestCrudService, public utilsService: UtilsService, public route: ActivatedRoute, public userService: UserService, public translate: TranslateService, public fieldConverter: FieldConverter, public spinnerA: NgxSpinnerService, ) {} and then use "this.spinnerA.show()/this.spinnerA.hide();" to call each of them, but they all hide as soon as the first finished receiving data. – Riccardo Fachin Jun 22 '20 at 13:08
  • Post stackblitz for same. – Shabbir Dhangot Jun 22 '20 at 19:17

0 Answers0