это результат fetch.php, который содержится в данных со страницы базы данных mysql
[{"id": "1", "name": "Moblie phone", "price": "3000"," image ":" mobil1 "," desc ":" samasong mobile garand prime 2 + "}, {" id ":" 2 "," name ":" Watch "," price ":" 200 ","image ":" watch "," desc ":" современные часы, их цвет - золото "}, {" id ":" 3 "," name ":" Labtop "," price ":" 4000 "," image ":"labtop", "desc": "hp labtop core i5 space 500gb"}, {"id": "4", "name": "moble lite", "price": "1999", "image": "mobil2"," desc ":" moble lite sterrr "}]
этот HTML-код
<!DOCTYPE html>
<html>
<head>
<title>shoping cart</title>
<link rel="stylesheet" type="text/css" href="functions/bootstrap.css">
<script type="text/javascript" src="functions/jquery.js"></script>
<script type="text/javascript" src="functions/bootstrap.min.js"></script>
<script type="text/javascript" src="functions/angular.min.js"></script>
</head>
<body>
<h2 align="center">Shopping cart application by angularjs and php</h2>
<div class="container" ng-app="shoppingcart" ng-controller="shoppingcartcontroller">
<div class="row " >
<div class="box col-md-3" style="margin-top: 20px"
ng-repeat="p in products">
{{p.name}}
{{p.price}}
</div>
</div>
</div>
этот код angularjs
<script >
var app=angular.module("shoppingcart",[]);
app.controller("shoppingcartcontroller",function($http,$scope){
$scope.loadproduct=function(){
$http.get("fetch.php").then(function(response){
$scope.products=response.data.data;
console.log($scope.products);
});
};
});
</script>