I'm trying to use the native keyboard "Go" button in my login form in a PhoneGap iOS app made with AngularJS, when the user click on the "Go" button i want to launch the "connect()" function of my controller. the "ng-submit" directive is not working :
<form ng-submit="connect(mail,password);" >
<input iscroll-bug type="mail" ng-model="mail" placeholder="E-mail">
<input iscroll-bug id='password' type="password" ng-model="password" placeholder="Mot de passe" >
<div ng-hide='loader' class="yellow_btn" ng-click="connect(mail,password);" ><p>Se connecter</p></div>
<img style='width:30px;' class='center' ng-show='loader' src='img/ajax-loader.gif' /><br/>
</form>
I think maybe the solution is in create a new Directive to force the action of the "onSubmit" event, i tried something like this :
// Other directive i Have
.directive('submitForm', function ($timeout, callbackOnSubmit) {
return {
link : function(scope, element, attrs) {
element.submit(function () {
callbackOnSubmit();
})
}
}
});
and use it like this :
<form submitForm="connect(mail,password)" >
Not working so I'm probably getting it wrong in my directive, is anyone already have this similar issues and solve it ? Thanks