import { Component } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html'
})
export class AppComponent {
  constructor(
    private router:Router
  ) {
    const agent:any = navigator.userAgent.toLowerCase();
    const isIE = agent.indexOf('compatible') > -1 && agent.indexOf('MSIE') > -1;
    const isIE11 = agent.indexOf('Trident') > -1 && agent.indexOf('rv:11.0') > -1;
    const isEdge = agent.indexOf('Edge') > -1 && !isIE;
    if (isIE || isIE11 || isEdge) {
      this.router.navigateByUrl('/browser');
    }
  }

  title = 'ChemZoo';
}
