Home > other >  Angular4 application, detect browser version, and to prevent use in IE
Angular4 application, detect browser version, and to prevent use in IE

Time:02-05


Is there a angular4 library (typescript), help detect browser type in there?
I'm using angular4 and want to know how to find browser type, the application load time I basically do not want my application load time, someone to use IE browser, or display a message that they need to use the chrome or Firefox,
I have been looking at the library, but they have a problem, or is the point of view that the elderly version

https://www.npmjs.com/package/ua-parser-js - the library support 1 x's point of view, I am in angular4
https://github.com/KoderLabs/ng2-device-detector - there was a problem in Internet explorer start, so can't as expected

If by angular4 substitute for types of script code or other Suggestions, I can detect the browser type of work, I want to know how to do,
Thank you






CodePudding user response:


Please check https://www.npmjs.com/package/ng2-responsive
Can show/hide components based on browser type, I hope it is helpful,
@ Component ({
The selector: 'my - component,
The template: '

I 'l l show you if I' m a Chrome Browser. & lt;/p>

I 'l l show you if I' m a Firefox Browser. & lt;/p>

I 'l l show you if I' m a Safari Browser. & lt;/p>

I 'l l show you if I' m a Opera Browser. & lt;/p>

I 'l l show you if I' m a Internet Explorer Browser. & lt;/p>
'
})

CodePudding user response:

This is from foreign websites, you copied the? How to use the ne
  • Related