[Fixed] How to detect browser with Angular?

Issue

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

Solution

I have used this before and it worked well.

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

Leave a Reply

(*) Required, Your email will not be published