Created
February 5, 2016 18:19
-
-
Save danmatthews/3ed7498240e776cf7597 to your computer and use it in GitHub Desktop.
Native Service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp.factory('NativeService', [function(){ | |
return { | |
run: function(nativeCallback, browserCallback) { | |
var dev = ionic.Platform.device(); | |
if ('available' in dev) { | |
nativeCallback(); | |
} else { | |
browserCallback(); | |
} | |
} | |
}; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment