redoc/lib/services/app-state.service.ts

25 lines
551 B
TypeScript
Raw Normal View History

2016-10-23 20:18:42 +03:00
'use strict';
2016-11-23 02:23:32 +03:00
import { Injectable, NgZone } from '@angular/core';
2016-10-23 20:18:42 +03:00
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
2016-11-23 02:23:32 +03:00
import { Injector } from '@angular/core';
2016-10-23 20:18:42 +03:00
@Injectable()
export class AppStateService {
samplesLanguage = new Subject<string>();
error = new BehaviorSubject<any>(null);
2016-11-23 02:23:32 +03:00
loading = new Subject<boolean>();
startLoading() {
this.loading.next(true);
}
stopLoading() {
this.loading.next(false);
}
constructor(private injector: Injector, private zone: NgZone) {
}
2016-10-23 20:18:42 +03:00
}