src/app/core/spinner/spinner.service.ts
Properties |
|
Methods |
constructor()
|
Defined in src/app/core/spinner/spinner.service.ts:10
|
hide |
hide()
|
Defined in src/app/core/spinner/spinner.service.ts:19
|
Returns :
void
|
show |
show()
|
Defined in src/app/core/spinner/spinner.service.ts:15
|
Returns :
void
|
spinnerState |
spinnerState:
|
Default value : this.spinnerSubject.asObservable()
|
Defined in src/app/core/spinner/spinner.service.ts:10
|
Private spinnerSubject |
spinnerSubject:
|
Default value : new Subject<SpinnerState>()
|
Defined in src/app/core/spinner/spinner.service.ts:8
|
import {Injectable} from '@angular/core';
import {Subject} from "rxjs";
import {SpinnerState} from "./spinner-state";
@Injectable()
export class SpinnerService {
private spinnerSubject = new Subject<SpinnerState>();
spinnerState = this.spinnerSubject.asObservable();
constructor() {
}
show() {
this.spinnerSubject.next(<SpinnerState>{show: true})
}
hide() {
this.spinnerSubject.next(<SpinnerState>{show: false})
}
}