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

22 lines
479 B
TypeScript
Raw Normal View History

2016-10-23 20:18:42 +03:00
'use strict';
2016-12-02 12:59:29 +03:00
import { Injectable } from '@angular/core';
2016-10-23 20:18:42 +03:00
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@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>();
2016-12-02 12:59:29 +03:00
initialized = new BehaviorSubject<any>(false);
2016-11-23 02:23:32 +03:00
startLoading() {
this.loading.next(true);
}
stopLoading() {
this.loading.next(false);
}
2016-10-23 20:18:42 +03:00
}