Ough sorry.. ng-submit is used for bind the onsubmit event and prevent traditional submission way, to use angular way with $http module. Btw why not to use $http.
On Monday, January 26, 2015 at 12:19:21 PM UTC+6, Jonathan Price wrote: > > I didn’t see a way to accomplish this traditional form submission using > ng-submit. Could you point to an example? > > On Jan 25, 2015, at 9:50 PM, Tash Chainar <[email protected] <javascript:>> > wrote: > > Try to add a name="giftform" attribute to the form. > Also look for ng-submit directive for alternative approach. > > On Monday, January 26, 2015 at 4:13:58 AM UTC+6, Jonathan Price wrote: >> >> So, I get why traditional form submission isn't really supported or >> recommended. But I have a situtation where I need to build a form and >> submit it to paypal, and I'm really struggling to make it work. I have >> something like this now: >> >> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" >> id="giftform"> >> <input type="hidden" name="item_name" value="$25 gift >> certificate" ng-model="model.item_name"> >> <input type="hidden" name="amount" value="25.00" >> ng-model="model.amount"> >> >> <button class="btn btn-success" style="font-size: 20px;" >> ng-click="gimme();">Gimme!</button> >> >> and a controller with this: >> >> >> $scope.gimme = function() { >> console.log(document.giftform); >> document.giftform.item_name = $scope.model.selectedItem.textvalue; >> document.giftform.amount = $scope.model.selectedItem.denomination; >> // document.giftform.submit(); >> } >> >> And I'm getting : Error: document.giftform is undefined >> >> >> Surely this isn't so complicated, and I'm just missing something simple? >> >> > -- > You received this message because you are subscribed to a topic in the > Google Groups "AngularJS" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/angular/4jrnchXOu0c/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected] <javascript:>. > To post to this group, send email to [email protected] <javascript:> > . > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
