Skip to content

Commit

Permalink
Missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Thomson committed Mar 19, 2014
1 parent e90ddc4 commit 8bf3f97
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app/scripts/services/isMobile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use strict';

angular.module('crunchinatorApp.services').service('IsMobile', [function() {


var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};

return isMobile;
}]);

0 comments on commit 8bf3f97

Please sign in to comment.