message: added multiple loading to config service
diff: @@ -13,28 +13,30 @@ export class ConfigService {
  constructor(private http: Http) { }
  - public get(key: string | Array<string>): Observable<any> {
  - if (Array.isArray(key)) {
  - // if (this.config) {
  - // let result = [];
  - //
  - // for (let k in this.config) {
  - // if ((this.config as Object).hasOwnProperty(k)) {
  - // result.push(this.config[k]);
  - // }
  - // }
  - //
  - // return Observable.of(result);
  - // } else {
  - // return this.load().map(() => this.config[key]);
  - // }
  - } else {
  + public get(key: string | Array<string>): Observable<any | Array<any>> {
  + let isArray = Array.isArray(key);
  +
  if (this.config) {
  - return Observable.of(this.config[key]);
  - } else {
  - return this.load().map(() => this.config[key]);
  + return Observable.of(this.getResult(isArray, key));
  }
  +
  + return this.load().map(() => this.getResult(isArray, key));
  + }
  +
  + private getResult(isArray: boolean, key: string | Array<string>): any {
  + return isArray ? this.getArrayResult(key as Array<string>) : this.config[key as string];
  }
  +
  + private getArrayResult(keyArray: Array<string>): Array<any> {
  + let result = [];
  +
  + for (let key in this.config) {
  + if ((this.config as Object).hasOwnProperty(key) && keyArray.includes(key)) {
  + result.push(this.config[key]);
  + }
  + }
  +
  + return result;
  }
  private load(reload = false): Observable<any> {
  