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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -