mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-23 10:50:13 +01:00
Theme styles added and useless files rm
This commit is contained in:
parent
27dcebeba2
commit
f87b6ce425
28 changed files with 1210 additions and 231 deletions
|
|
@ -1,39 +0,0 @@
|
|||
import {Injectable} from 'angular2/core';
|
||||
import {HmrState} from 'angular2-hmr';
|
||||
|
||||
@Injectable()
|
||||
export class AppState {
|
||||
// HmrState uis used by HMR to track the any state during reloading
|
||||
@HmrState() _state = {};
|
||||
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
// already return a clone of the current state
|
||||
get state() {
|
||||
return this._state = this._clone(this._state);
|
||||
}
|
||||
// never allow mutation
|
||||
set state(value) {
|
||||
throw new Error('do not mutate the `.state` directly');
|
||||
}
|
||||
|
||||
|
||||
get(prop?: any) {
|
||||
// use our state getter for the clone
|
||||
const state = this.state;
|
||||
return state[prop] || state;
|
||||
}
|
||||
|
||||
set(prop: string, value: any) {
|
||||
// internally mutate our state
|
||||
return this._state[prop] = value;
|
||||
}
|
||||
|
||||
|
||||
_clone(object) {
|
||||
// simple object clone
|
||||
return JSON.parse(JSON.stringify( object ));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue