i have following code but my page does not show data...;( i don't now why please help me, i am new in angularjs. I AM calling web API its working fine console log show json record, but in my page record does now show... why
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/angular.min.js"></script>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("http://localhost:9000/employees").then(function (response) {
$scope.myData = response.data;
});
});
</script>
</head>
<body>
<div ng-app="myApp" ng-controller="customersCtrl">
<br>
<p>Today's welcome message is:</p>
<!--<h1>{{myWelcome}}</h1>-->
<ul>
<li ng-repeat="x in myData">
<li ng-repeat="x in myData">
{{ x.ProductName }} ',' {{ x.ProductDescription }}
</li>
<!--{{ x.ProductName + ', ' + x.ProductDescription }}-->
</li>
</ul>
</div>
</body>
</html>
result = [{"ID":1,"ProductName":"xcxc","ProductDescription":"xcxc","UnitPrice":2323,"QtyAvailable":23}]
its show below error in chrome console log
See Question&Answers more detail:osXMLHttpRequest cannot load http://localhost:9000/employees. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.