0

How can I determine mobile browser using AngularJS? We can detect the browser using JavaScript, just wondering Angular has a different way to detect browser or device.

1

2 Answers 2

1

Depending on the version of angular:

If in Angular 1 you can use the $window object.

That object is gone in Angular 2, however, but there is also ng-device-detector which works on Angular 2 and does a decent job at getting device, OS, and browser info.

I would just use pure JS or third party library specifically made for this function. Angular is not meant to replace JavaScript or web/browser APIs, when you try to use angular in unintended ways you often run into trouble.

Sign up to request clarification or add additional context in comments.

Comments

0

you can use "ng-device-detector" in AngularJS

reference : here

ngDeviceDetector is a library which help detect the OS, browser and device in AngularJS application with ease.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.