import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; import { environment } from '../environments/environment'; import { HttpClient } from '@angular/common/http'; @Component({ selector: 'cbms-head-lib', templateUrl: './head.component.html', styleUrls: ['./head.component.scss'], changeDetection: ChangeDetectionStrategy.Eager, standalone: false }) export class HeadComponent implements OnInit { imageUrl:string=''; nonProdBackColor:boolean; prodBackColor:boolean; headerBackgroundColor; constructor(private http: HttpClient) { } public currentDate:Date = new Date(); ngOnInit() { this.http.get("./assets/config.json").subscribe(res => { const isProductionEnv = res["isProductionEnv"]; if (!isProductionEnv) { // Non-production Env console.log("nonProdHeaderLogoImageUrl: " + res["nonProdHeaderLogoImageUrl"]); this.imageUrl = "./assets/images/" + res["nonProdHeaderLogoImageUrl"]; this.nonProdBackColor = true; this.prodBackColor = false; this.headerBackgroundColor = res["nonProdHheaderBackOrangeColorCode"]; } else {// Production Env console.log("prodHeaderLogoImageUrl: " + res["prodHeaderLogoImageUrl"]); this.imageUrl = "assets/images/" + res["prodHeaderLogoImageUrl"]; this.nonProdBackColor = false; this.prodBackColor = true; } }) } }