JSON Question

angularjs http get from json url

I have problem with this code I have json data from my asp.net web api. I could not get this data by angularjs. as you can see the the code;

<!DOCTYPE html>
<html ng-app="myapp">
<head>
<title ng-bind="helloAngular"></title>
<script src="~/Scripts/angular.min.js"></script>
<script>
var myapp = angular.module('myapp', []);
myapp.controller('myController', function ($scope, $htpp){
$htpp.get({
method:'GET',
url:'http://localhost:50972/api/product'})
.success(function (response) {
$scope.result = response.statusText
});
});
</script>
</head>
<body ng-controller="myController">
<table border="1">
<tr ng-repeat="product in response">
<td>{{product.id}}</td>
<td>{{product.name}}</td>
<td>{{product.type}}</td>
</tr>
</table>
</body>
</html>

Answer

You have some typo errors: instead of $htpp use $http

myapp.controller('myController', function ($scope, $http){
                    $http.get({
                        method:'GET',
                        url:'http://localhost:50972/api/product'})
                        .success(function (response) {
                        $scope.result = response.data;
                    });
                });