Skip to content

Instantly share code, notes, and snippets.

@azizkale
Last active August 9, 2021 17:53
Show Gist options
  • Save azizkale/c6bcf073318cfcacb04662d2682d4f14 to your computer and use it in GitHub Desktop.
Save azizkale/c6bcf073318cfcacb04662d2682d4f14 to your computer and use it in GitHub Desktop.
how to send data to webservice in AngularJS
angCtlTable.factory("facYeniDonemAc", ["$http", function ($http) {
var fac = {};
fac.YeniDonemAc = function (kullaniciAdi, ay, yil, ctladi) {
return $http({
method: "POST",
url: "CTL_CRUDOperations.asmx/YeniDonemOlustur",
data: {
kullaniciAdi: kullaniciAdi,
ay: ay,
yil: yil,
ctlAdi: ctladi
}
}).then(function () {
alert("suuceessfully");
},function (){
alert("error");
});
}
return fac;
}]);
angCtlTable.service("serYeniDonemAc", function ($http) {
this.YeniDonemAc = function (kullaniciAdi, ay, yil, ctladi) {
var post = {
method: "POST",
url: "CTL_CRUDOperations.asmx/YeniDonemOlustur",
data: {
kullaniciAdi: kullaniciAdi,
ay: ay,
yil: yil,
ctlAdi: ctladi
}
};
$http(post).then(function () {
alert("successfully");
}, function () {
alert("error");
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment