I need to determine if my project is being opened in Internet Explorer. If it is, the first component should be displayed, otherwise a different component should be shown in another browser OS.
import { Component, AfterViewInit} from '@angular/core';
import { Router } from '@angular/router';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
declare var $:JQueryStatic;
var isIE;
var isEdge = !isIE && !!(<any>window).StyleMedia;
if(isEdge==true){
@Component({
templateUrl: `./texttoindex.component.html`,
styleUrls: ['./textcss.css']
})
export class CrisisCenterHomeComponent implements AfterViewInit{
ngAfterViewInit() {
}
}
}else{
@Component({
templateUrl:'./interexplorer.html',
styleUrls:['./textcss.css']
})
export class CrisisCenterHomeComponent1 implements AfterViewInit{
ngAfterViewInit(){}
}
}
My code checks if the browser is Internet Explorer and displays the appropriate HTML file accordingly. Can someone please assist me in finding a solution?