File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 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 ( / A n d r o i d / i) ;
9+ } ,
10+ BlackBerry : function ( ) {
11+ return navigator . userAgent . match ( / B l a c k B e r r y / i) ;
12+ } ,
13+ iOS : function ( ) {
14+ return navigator . userAgent . match ( / i P h o n e | i P a d | i P o d / i) ;
15+ } ,
16+ Opera : function ( ) {
17+ return navigator . userAgent . match ( / O p e r a M i n i / i) ;
18+ } ,
19+ Windows : function ( ) {
20+ return navigator . userAgent . match ( / I E M o b i l e / i) ;
21+ } ,
22+ any : function ( ) {
23+ return ( isMobile . Android ( ) || isMobile . BlackBerry ( ) || isMobile . iOS ( ) || isMobile . Opera ( ) || isMobile . Windows ( ) ) ;
24+ }
25+ } ;
26+
27+ return isMobile ;
28+ } ] ) ;
You can’t perform that action at this time.
0 commit comments