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
  • 30,952
  • 84
  • 245
  • 427

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
  • 13,491
  • 4
  • 34
  • 69