mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-14 12:24:21 +01:00
25 lines
452 B
TypeScript
25 lines
452 B
TypeScript
|
|
import {Injectable} from 'angular2/core'
|
||
|
|
import {Subject} from 'rxjs/Subject';
|
||
|
|
|
||
|
|
@Injectable()
|
||
|
|
export class ThemeGlobal {
|
||
|
|
private _data = new Subject<Object>();
|
||
|
|
|
||
|
|
dataStream$ = this._data.asObservable();
|
||
|
|
|
||
|
|
constructor() {
|
||
|
|
}
|
||
|
|
|
||
|
|
setData(key, value) {
|
||
|
|
let current = this._data[key];
|
||
|
|
if (current != value) {
|
||
|
|
this._data[key] = value;
|
||
|
|
this._data.next(this._data);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
getDataStream() {
|
||
|
|
return this.dataStream$;
|
||
|
|
}
|
||
|
|
}
|