import { Injectable } from "@angular/core" ; import { Http , Response } from "@angular/http" ; import { map } from "rxjs/operators" ; @ Injectable ( ) export class SettingsService { private oauthSettings : OauthSettings = null ; constructor ( private readonly httpService ) { } getOauthSettings ( ) { return this . oauthSettings ; } load ( ) { const oauthPromise = this . httpService . get ( `/api/Settings/GetOauthSettings` ) . pipe ( map ( ( res ) => { const settings = < OauthSettings > res . json ( ) ; this . oauthSettings = settings ; console . warn ( this . oauthSettings ) ; } ) ) . toPromise ( ) ; const isLoadedPromise = Promise . all ( [ oauthPromise ] ) . then ( ( ) => { return true ; } ) ; return isLoadedPromise ; } } export class OauthSettings { ClientId : string ; Tenant : string ; SignInPolicyId : string ; SignUpPolicyId : string ; GetAccessScopes : string ; RedirectUri : string ; RefreshTokenSlidingWindowLifetime : number ; }