I would like to display data from API using angularJS. This code works fine when run code on same PC. But when I tried to test on another PC then it is displaying error no access-control-allow-origin' header is present on the requested resource. angularjs
I am using 1.4.8
Here is my code :
$http({
method:"get",
url: 'http://IP/Test_API/index.php/test123_api/empdtl_from_empid/emp_id/'+$scope.empId
})
.success( function( response ){
if (response != null || response != 'undefined') {
$scope.empNm = response.data.emp_name;
}
})
.error( function( response ) {
if(response.statusCode == 404)
{
$scope.errorEmpNm = "You May Inputted Wrong Employee Id which have not Exist, Please Enter Correct Employee Id...!!!";
}
})