summaryrefslogtreecommitdiffstats
path: root/portal-FE-os/src/app/app.component.ts
diff options
context:
space:
mode:
authorSudarshan Kumar <sudarshan.kumar@att.com>2020-04-24 15:01:03 +0530
committerSudarshan Kumar <sudarshan.kumar@att.com>2020-04-24 15:03:22 +0530
commit4b6148660fd85582d44245079b2e6c3c84200b59 (patch)
tree19ff0dcc90415046f06442d32943586f2d4deb44 /portal-FE-os/src/app/app.component.ts
parentd7f3b463c9f0f11ceb0aad255f564b02c22ab978 (diff)
Fixed IE issue and integrated Banner
Fixed IE issue and integrated best views display banner Issue-ID: PORTAL-889 Change-Id: I6e922431d5033b41de5d8a4ab0e8ccb776062011 Signed-off-by: Sudarshan Kumar <sudarshan.kumar@att.com>
Diffstat (limited to 'portal-FE-os/src/app/app.component.ts')
-rw-r--r--portal-FE-os/src/app/app.component.ts44
1 files changed, 40 insertions, 4 deletions
diff --git a/portal-FE-os/src/app/app.component.ts b/portal-FE-os/src/app/app.component.ts
index dbfb568f..389153bd 100644
--- a/portal-FE-os/src/app/app.component.ts
+++ b/portal-FE-os/src/app/app.component.ts
@@ -35,13 +35,49 @@
*
*
*/
-import { Component } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
+import { environment } from 'src/environments/environment';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
-export class AppComponent {
-
-}
+export class AppComponent implements OnInit {
+ diaplayBanner : boolean = false;
+ api = environment.api;
+ browserCompatibilityMsg: string;
+
+ ngOnInit() {
+ this.diaplayBanner = false;
+ this.browserCompatibilityMsg = this.api.browserCompatibilityMsg;
+ this.getBrowserName();
+ }
+
+ /**
+ * Identify Browser
+ */
+ getBrowserName() {
+ const agent = window.navigator.userAgent.toLowerCase();
+ switch (true) {
+ case agent.indexOf('edge') > -1:
+ return 'edge';
+ case agent.indexOf('opr') > -1 && !!(<any>window).opr:
+ this.diaplayBanner = true;
+ return 'opera';
+ case agent.indexOf('chrome') > -1 && !!(<any>window).chrome:
+ return 'chrome';
+ case agent.indexOf('trident') > -1:
+ this.diaplayBanner = true;
+ return 'ie';
+ case agent.indexOf('firefox') > -1:
+ return 'firefox';
+ case agent.indexOf('safari') > -1:
+ this.diaplayBanner = true;
+ return 'safari';
+ default:
+ this.diaplayBanner = true;
+ return 'other';
+ }
+ }
+} \ No newline at end of file