You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
386 B
TypeScript
20 lines
386 B
TypeScript
|
2 weeks ago
|
import { Injectable } from '@angular/core';
|
||
|
|
import { BehaviorSubject } from 'rxjs';
|
||
|
|
|
||
|
|
@Injectable({
|
||
|
|
providedIn: 'root'
|
||
|
|
})
|
||
|
|
export class LoadingService {
|
||
|
|
|
||
|
|
private loadingSubject = new BehaviorSubject<boolean>(false);
|
||
|
|
loading$ = this.loadingSubject.asObservable();
|
||
|
|
|
||
|
|
showLoader() {
|
||
|
|
this.loadingSubject.next(true);
|
||
|
|
}
|
||
|
|
|
||
|
|
hideLoader() {
|
||
|
|
this.loadingSubject.next(false);
|
||
|
|
}
|
||
|
|
}
|