Improved spinner logic and table design #130
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject } from "rxjs";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SpinnerService {
|
||||
|
||||
showSpinnerState = false;
|
||||
showSpinnerState$ = new BehaviorSubject<boolean>(false);
|
||||
constructor() { }
|
||||
|
||||
showSpinner() {
|
||||
this.showSpinnerState = true;
|
||||
this.showSpinnerState$.next(true);
|
||||
}
|
||||
|
||||
hideSpinner() {
|
||||
this.showSpinnerState = false;
|
||||
this.showSpinnerState$.next(false);
|
||||
}
|
||||
|
||||
toggleSpinner() {
|
||||
this.showSpinnerState = !this.showSpinnerState;
|
||||
this.showSpinnerState$.next(!this.showSpinnerState$.value);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user