How to detect browser with Angular?

Liutas picture Liutas · Jan 10, 2018 · Viewed 94.7k times · Source

I need to detect if browser is IE or Edge with Angular (TypeScript). Is it possible? If so, how?

Answer

argoo picture argoo · Jan 10, 2018

I have used this before and it worked well.

const isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent)