angularjs - API working in browser but not working from angular js code displaying CORS issue -
i trying integrate api freshdesk, giving json output while using in browser. when used in angular js code, browser showing cors issue.
in api service:
function getticket(api, param,isarray) { var request = $resource(remoteservicenametickets + api, param, { authenticate: { method: 'get', isarray: isarray, headers: { 'content-type': 'application/json', 'authorization':'ocabjxpwzjsgvbzt3i:x' } } }); return request.authenticate().$promise.then(function (response) { if (response.status == '401') {//401 unauthorized return; }; return response; }, function (response) { //check error status }); }
in controller
function createticket(){ $scope.values=apiservice.getticket('helpdesk/tickets/26673.json'); }
Comments
Post a Comment