1

controller.js

$http({
     method: 'POST',
     url: 'here API url',
     headers: {'Content-Type': 'application/json'},
     data: data
 }).then(function successCallback(response) {
     if (response.data) {
         sharedServices.set(response.data);
     }
     console.log(response);
 }, function errorCallback(response) {
     if (response) {
         $scope.message = response.data;
     }
 });

This is my controller file. Error in browser console "XMLHttpRequest cannot load "here API url".No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63342' is therefore not allowed access. The response had HTTP status code 500."

BalaDev
  • 193
  • 1
  • 2
  • 11

0 Answers0