I am calling one java by using $http in angularjs but I am getting this error in Chrome:
XMLHttpRequest cannot load http://192.168.1.104:8080/etts/Abilityscore?userid=1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
My code is:
var countryApp = angular.module('countryApp', []);
countryApp.controller('CountryCtrl', function ($scope, $http){
alert("eee")
$http.get('http://192.168.1.104:8080/etts/Abilityscore?userid=1
').success(function(data) {
$scope.countries = data;
var sum = 0;
var tval = 0;
for(var i = 0; i < data.length; i++){
sum += parseInt(data[i]['getval'], 10);
tval += parseInt(data[i]['totalval'], 10);
}