I want get JSON objects from my Rest Api. I used GET method in AngularJs. But it gives me an error.
This is an error.
XMLHttpRequest cannot load http://localhost:8080/MealMobile/webapi/meals/meal_type. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.
This is my controller.
eventApp.controller('requestCtrl',function($scope, $http, $log) {
$http({
method:'GET',
url:'http://localhost:8080/MealMobile/webapi/meals/meal_type'})
.then(function (response) {
$scope.loginData = response.data;
$log.info(response);
}
);
});
Server is up and url is also working. Therefore I can't find a solution. Can you give me an answer for this..