Last active
August 26, 2015 07:49
-
-
Save ramingar/6c3a94f39a053549727f to your computer and use it in GitHub Desktop.
Función para abrir una aplicación nativa desde phonegap #phonegap #angular #window #open #native #window.open
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
<script> | |
// At the controller: | |
$scope.redirectToSystemApp = function (url, protocol) { | |
if (typeof protocol == 'undefined') { | |
window.open(encodeURI(url), '_system', 'location=yes'); | |
preventDefault(); | |
} else { | |
window.open(protocol + ':' + url, '_system'); | |
} | |
}; | |
</script> | |
<!-- Usage: --> | |
<ons-button modifier="light" class="show-map" | |
ng-click="redirectToSystemApp('0,0?q='+ activity.location, 'geo')"> | |
</ons-button> | |
<div ng-click="redirectToSystemApp(organization.phone, 'tel')"></div> | |
<div ng-model="organization.email" ng-click="redirectToSystemApp(organization.email, 'mailto')"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment