Skip to content

Commit 8bf3f97

Browse files
author
Nicholas Thomson
committed
Missing file
1 parent e90ddc4 commit 8bf3f97

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

app/scripts/services/isMobile.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)