Hi, It is already asynchron from your client application viewpoint. What other asynchronicity you would like to achieve?
Thanks, András - - -- Csanyi Andras (Sayusi Ando) -- http://sayusi.hu -- http://facebook.com/andras.csanyi -- ""Trust in God and keep your gunpowder dry!" - Cromwell On 26 July 2016 at 08:52, Frijx Frijx <[email protected]> wrote: > Hi all, > > I'm trying to convert the following post to async, I dont know if anyone > could possibly help me ? > > angular.module('testAsync').controller('ContactController', function ( > $scope, $http) { > $scope.sendMail = function () { > document.getElementById("info").innerHTML = "Sending, Please > Wait..."; > document.getElementById("sendThatMail").style.visibility = > "hidden"; > document.getElementById("sender").style.visibility = "visible"; > var data = $.param({ > emailAddress: $scope.emailAddress, > emailMessage: "--- Name : " + $scope.myName + "--- Email > Address : " + $scope.emailAddress + "--- Msg : " + $scope.myMsg, > emailSubject: $scope.mySubject > //emailName: $scope.myName > }); > $http.post("api/SendMail", data, { headers: { 'Content-Type': > 'application/x-www-form-urlencoded' } }).success(function (data) { > $scope.results = data; > document.getElementById("info").innerHTML = data; > document.getElementById("sender").style.visibility = "hidden"; > document.getElementById("sendThatMail").style.visibility = > "visible"; > }).error(function () { > alert("error"); > document.getElementById("sender").style.visibility = "hidden"; > document.getElementById("info").innerHTML = "Error Sending, > Please try again..."; > document.getElementById("sendThatMail").style.visibility = > "visible"; > }); > > > }; > }); > > -- > 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 https://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 https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
