Skip to content
Snippets Groups Projects
AppConfiguration.ts 560 B
Newer Older
cazenave's avatar
cazenave committed
import { Injectable } from "@angular/core";
import { HttpClient } from '@angular/common/http';

@Injectable()
export class AppConfiguration {
  fdpurl: string;
  fdpemail: string;
  fdppassword: string;

constructor(private httpClient: HttpClient){};

public ensureInit(): Promise<any> {
    return new Promise((r, e) => {  
      this.httpClient.get("assets/conf/fdpsetting.json")
        .subscribe(
        (content: AppConfiguration) => {
          Object.assign(this, content);
          r(this);
        },
        reason => e(reason));
    });
  };

}