import { Component, OnInit } from '@angular/core'; import { ManifestService } from 'src/app/shared/services'; import { environment } from 'src/environments/environment'; declare var runAnalytics: any @Component({ selector: 'app-footer', templateUrl: './footer.component.html', styleUrls: ['./footer.component.scss'] }) export class FooterComponent implements OnInit { buildVersion: string; api = environment; brandName: string; footerLink: string; footerLinkText: string; footerMessage: string; footerLogoImagePath: string; footerLogoText: string; constructor(private manifest: ManifestService) { } ngOnInit() { this.buildVersion = ''; this.manifestDetails(); this.brandName = "ONAP Portal SDK"; if(this.api.brandName != ''){ this.brandName = this.api.brandName; } this.footerLink = this.api.footerLink; this.footerLinkText = this.api.footerLinkText; this.footerMessage= this.api.footerMessage; if(this.api.footerLogoImagePath !=''){ this.footerLogoImagePath= this.api.footerLogoImagePath; } this.footerLogoText= this.api.footerLogoText; this.portalHook(); } manifestDetails() { this.manifest.getManifest().subscribe((_res: any) => { this.buildVersion = _res['Build-Number']; }, (_err) => { }); } portalHook() { let done = false; let script = document.createElement('script'); script.src = "api/v3/analytics" script.async = true; script.onload = ()=> { runAnalytics(); } document.head.appendChild(script); } }