We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e90ddc4 commit 8bf3f97Copy full SHA for 8bf3f97
1 file changed
app/scripts/services/isMobile.js
@@ -0,0 +1,28 @@
1
+'use strict';
2
+
3
+angular.module('crunchinatorApp.services').service('IsMobile', [function() {
4
5
6
+ var isMobile = {
7
+ Android: function() {
8
+ return navigator.userAgent.match(/Android/i);
9
+ },
10
+ BlackBerry: function() {
11
+ return navigator.userAgent.match(/BlackBerry/i);
12
13
+ iOS: function() {
14
+ return navigator.userAgent.match(/iPhone|iPad|iPod/i);
15
16
+ Opera: function() {
17
+ return navigator.userAgent.match(/Opera Mini/i);
18
19
+ Windows: function() {
20
+ return navigator.userAgent.match(/IEMobile/i);
21
22
+ any: function() {
23
+ return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
24
+ }
25
+ };
26
27
+ return isMobile;
28
+}]);
0 commit comments