Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module("myApp", ['ngRoute'])
- .controller('myCtrl', myCtrl)
- .controller('common', common)
- .config('configuration', configuration)
- .factory('cprPostService', cprPostService);
- function cprPostService($http) {
- var promise;
- //params need to pass -url,json object and loading alert message
- var cprPostService = {
- postJsonService: function(url,jsonObj) {
- var reqData = "reqData="+jsonObj;
- promise = $http({
- method: 'POST',
- url:url,
- data: 'reqData='+jsonObj,
- headers: {'Content-Type': 'application/x-www-form-urlencoded'}
- }).success(function(data, status, headers, config) {
- }).error(function(data, status, headers, config) {
- // alert("Error :: "+data);
- });
- // Return the promise to the controller
- return promise;
- }
- };
- return cprPostService;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement