Hi all,
I’m trying to submit a form using the right button in the header (as it’s often the case in iOS7) but I’m stuck…
Here’s my form:
<form ng-submit="createContact(contact)">
<div class="list">
<label class="item item-input">
<span class="input-label">Name</span>
<input type="text" ng-model="contact.name">
</label>
</div>
</form>
And my controller:
$scope.rightButtons = [
{
type: 'button-clear',
content: 'Save',
tap: function () {
// I'd like to “submit” my form here
// i.e. trigger the $scope.createContact
// function
}
}
];
$scope.createContact = function (contact) {
console.log(contact.name);
};
Does anyone have an idea how I could access the form from within the controller, trigger its submit event and the createContact() function (along with the contact model parameter).
Many thanks in advance! Best regards,
David