http://here ip address :8080/hospital/user/profile this is my server link which provides a data but is fails to get data in my angular controller console gets the following error
XMLHttpRequest cannot load http://ip address of server:8080/hospital/user/profile. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
ctrl.$inject = ['$location','$scope', '$http', '$rootScope'];
function ctrl($location,$scope, $http, $rootScope){
$scope.reg = function(){
alert("in the function");
$http.get('http://ipaddr:8080/hospital/user/profile').success(function(response) {
$scope.data = response.data;
alert("in the function data is"+response);
console.log(response);
}).error(function(response){
alert(" Fail to Access Data");
});
};