Last active
August 9, 2021 17:53
-
-
Save azizkale/c6bcf073318cfcacb04662d2682d4f14 to your computer and use it in GitHub Desktop.
how to send data to webservice in AngularJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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