I've run into a problem in my app that I can't seem to find a solution to. My app collects form data, and I want one button at the bottom of the page to submit this form data and open up an sms message. I use ng-href with the sms: type and sanitzation in the compile provider to allow the button to open up an sms. This works without an ng-click on the same attribute, but when I attach an ng-click to that ng-href attribute, only the ng-click fires and the sms app is never opened.
Here's the relevant code
HTML
<a ng-href="sms:&body={{myMessage}}" ng-click="postData()">Invite</a>
AngularJS
$scope.myMesssage = "my message";
$scope.postData = function() {
// prep data
var myData = {
"formData": $scope.formData,
}
// post data
$http.post('/src/php/post.php', myData)
.success(function(data, status, headers, config){
})
.error(function(data, status, headers, config) {
});
};
The data is successfully submitted to the server, but no sms is opened. If I remove the ng-click, the sms opens. I saw this SO post about a similar issue and tried it to no avail. Any other ideas on how I can have ng-click and ng-href both execute on the same button?
If you would like any other information to help shed light on my issue, please ask. I stripped down my code to try and make my problem apparent, but I will happily provide more.