scotchApp.factory('mainPostFactory', function($modal,$http, $templateCache) { var factory = {}; factory.doCheckLogin = function () { return $.ajax(doGetPath('/json/doCheckLogin.json'), { ajax: true, dataType: 'json', type: "POST" }); }; factory.doAjaxPost = function (url,param) { return $.ajax(doGetPath(url), { ajax: true, dataType: 'json', type: "POST", data:param }); }; // factory.doHttpPost = function (url,param) { // return $http({ // url: doGetPath(url), // method: "POST", // data: param, // cache :$templateCache // }); // } // // factory.doHttpJsonP = function (url,param) { // return $.post(doGetPath(url), // { // ajax: true, // dataType: 'json', // type: "POST", // data:param // }); // } return factory; });