0

I know there are some libraries that can do this but I would like to do something as simple as possible and I didn't see any examples that were for an AngularJS app. The problem is I do not know where to start.

Can someone give me some advice or point me in the right direction.

Samantha J T Star
  • 28,982
  • 82
  • 233
  • 406

1 Answers1

1

angular
  .module('test', [])
  .run(function($rootScope) {
    $rootScope.isIpad = /ipad/i.test(navigator.userAgent);
  })
;
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>

<section ng-app="test">
  <h1>is iPad? <span ng-bind="isIpad | json"></span></h1>
</section>

if you want to have a more robust solution, have a look here Detect iPad users using jQuery?

Community
  • 1
  • 1
Hitmands
  • 12,577
  • 3
  • 30
  • 62