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.

Nehara Perera
  • 13
  • 1
  • 4
  • 3
    Possible duplicate of [How to detect browser using angular?](http://stackoverflow.com/questions/22947535/how-to-detect-browser-using-angular) – Ankh Mar 13 '17 at 08:32

2 Answers2

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.

Community
  • 1
  • 1
mand
  • 395
  • 2
  • 13
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.

Kapila Perera
  • 837
  • 1
  • 11
  • 24