angular.module("MyApp")
.controller("pucdes", function ($scope, locationder) {
$scope.Savedata = function () {
$scope.Submitted = true;
alert("ppp");
locationder.Sessiondata2($scope.myFunction)
.then(function (d) {
alert('fjfbffbjbf')
$scope.mess = "jjjjjjj.......sucess.......";
})
locationder.Sessiondata($scope.myFunction2)
.then(function (d) {
$scope.mess = "jjjjjjj.......sucess.......";
})
}
})
.factory("locationder", function ($http, $q) {
var fac = {};
fac.Sessiondata2 = function () {
// var defer = $q.defer();
$http({
url: '/Home/pubs3',
method: "POST",
data: JSON.stringify(),
headers: { 'content-type': 'application/json' }
})
}
fac.Sessiondata = function () {
$http({
url: '/Home/pubs2',
method: "POST",
data: JSON.stringify(),
headers: { 'content-type': 'application/json' }
})
}
//return defer.promise;
// }
return fac;
});
MayankPosted Nov 16, 2016, 6:11 AM
1. var mainApp = angular.module("mainApp", ['ngRoute', 'ngResource']);
2.
If you think it resolve your query please mark as answer
Francis SusaimichaelPosted Jul 19, 2016, 11:40 PM