I hope its useful, refer :
http://argutech.blogspot.in/2013/11/angularjs-how-to-connect-angularjs-with.html On Thu, Jan 16, 2014 at 9:14 AM, Aadithya C Udupa <[email protected]>wrote: > Is there a reason why you are not using AngularJS Services to make a POST > request? > Something like > > *In controller:* > *$scope.postData = function () {* > * > myAppFactory.postData($scope.profileList).success(function(response){* > * console.log("Success: "+response);* > * });* > * });* > * };* > > *In Factory:* > *myApp.factory('myAppFactory', ['$http', function ($http) { * > * var myAppFactory = {};* > * myAppFactory.postData = function (data) {* > * return $http({* > * url: '/Home/GetProfile',* > * method: "POST",* > * data: data* > * });* > * }* > * return myAppFactory;* > *}]);* > > > > > On Thu, Jan 16, 2014 at 2:30 AM, Rajesh Kumar <[email protected]> wrote: > >> Hi >> >> I am new to angularjs, I am having a array in my application >> >> $scope.profilelist = [ >> new Profile(1, "Mark", "Brunner", >> "[email protected]", "0999999999"),] >> >> On a button click of that scope i am adding Profiles inside the list >> using Push >> >> Finally i have another button inside same scope, on clicking i am using >> $.ajax call and passing data to my server >> >> $.ajax({ >> url: "/Home/GetProfile", >> type: "POST", >> data: { 'profilelist':($scope.profilelist) },//(new >> Profile(1,"dd","dd","dd","dd")) }); >> >> Myservercode: >> >> public JsonResult GetProfile(List<Profile> profilelist) >> >> the server profileist length and profilelist count is matching , but >> the values are empty >> >> >> Please help me >> >> Regards >> ccrkhere >> >> -- >> 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/groups/opt_out. >> > > > > -- > Regards, > Aadithya C Udupa > > -- > 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/groups/opt_out. > -- 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/groups/opt_out.
