Select Git revision
loader.service.ts
-
Etxaniz Errazkin, Iñaki authoredEtxaniz Errazkin, Iñaki authored
loader.service.ts 386 B
import { Injectable } from '@angular/core';
import { BehaviorSubject, Subject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class LoaderService {
isLoading$ = new BehaviorSubject<boolean>(false);
loader = this.isLoading$.asObservable();
constructor() { }
show() {
this.isLoading$.next(true);
}
hide() {
this.isLoading$.next(false);
}
}