File

src/app/services/feature-flag.service.ts

Index

Properties
Methods

Constructor

constructor(http: HttpClient)
Parameters :
Name Type Optional
http HttpClient no

Methods

getFeatureFlag
getFeatureFlag(domain: string)
Parameters :
Name Type Optional
domain string no
Returns : Observable<any>

Properties

domain$
domain$: any
Type : any
environment
environment: string
Type : string
Default value : ""
featureFlagUrl
featureFlagUrl: string
Type : string
Default value : ""
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';

@Injectable()
export class FeatureFlagService {
  domain$: any;
  constructor(private http: HttpClient) {}
  featureFlagUrl = "";
  environment = "";

  getFeatureFlag(domain: string): Observable<any> {
    this.environment = environment.production === true ? "prod" : "qa";
    this.featureFlagUrl = "https://flags.alliedpayment.com/" + domain.toLocaleLowerCase() + "/rt247_" + this.environment + "_p2p?t=" + new Date().getTime();
    const response = this.http.get(this.featureFlagUrl);
    return response;
  }
}

results matching ""

    No results matching ""