getjson.controller('controller', function($scope, $http){
var url = "http://api.8coupons.com/v1/getsubcategory";
$http.get(url).success(function(data, status, headers, config){
$scope.jsondata = data;
console.log(data);
}).error(function(data, status, headers, config){});
});
(ed's note: added a closing brace to the outer function body.)
This code gives me the following error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.api.8coupons.com/v1/getsubcategory. This can be fixed by moving the resource to the same domain or enabling CORS.
Can somebody please tell me what is wrong and how can I fix this?