Hi, I’m trying to integrate paypal into my ionic app. I’m using appinbrowser (I cannot get to work the paypal plugin).
I’ve created a form with all the necessary data but when I try to submit the form (not directly cause I need to submit it using $window.open) I cannot get it working, I always get the error:
TypeError: $scope.formScope.f1.submit is not a function, so the new window is opened but it always fails to complete the paypal form.
Form submissions in Angular need to use ng-submit, the method .submit() doesn’t exist in the scope you’ve obtained from ng-init. What you can do is obtain the parent element from formScope and using angular.element(formEl).submit() (.submit() is a jQuery Lite method) that will submit the form.
I’ve tried the following
var frm = angular.element(’#f1’);
frm.submit();
Now the form is submitted. But I have another issue (maybe you can help as well). I open a new window and I would like to load the submitted form into that window.
So far, I can only open a blank window and the content is loaded inside the parent instead the child.