Angular JS and HTTP jason data request
Angular JS and HTTP jason data request
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script type="text/javascript" scr="jscript.js> </script>
<body>
<div>
<h1>Testing Angular JS </h1>
<div>
<div ng-app="My APP" ng-controller="Planet Controller">
<table>
<tr>
<td>Planet Name</td>
<td>Planet distance</td>
</tr>
<tr>
<tr ng-repeat="x in names">
<td>{{x.names}}</td>
<td>{{x.distance}}</td>
</tr>
</table>
<div>
</body>
</html>
var app=angular.module('myApp',[]);
app.controller('planetController,function($scope,$http))
{
$http.get("http://www.bogotobogo.com/AngularJs/Files/httpRequest/planet.jason").success.function(response)
{
$scope.names=response;
}
);
}
);
Comments
Post a Comment