I'm new in Angular I want to get a SQL request from php script to angular, but I see only a big bulleted list and I dont know what is the problem.
My html code:
.
.
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.js">
</script>
<script src="../js/proc_list.js"></script>
.
.
.
<div align="center" id="prod_list" ng-controller="proc_list">
<ul>
<li ng-repeat="processor in proc">
{{processor.manufacturer}}
<p>{{processor.description}}</p>
{{processor.price}}
</li>
</ul>
</div>
Controller code:
function proc_list($scope, $http){
$http.post('../phps/get_proc_list.php').success(function(data){
$scope.proc = data;
});
}
PHP code:
$received_data = file_get_contents("php://input");
$objData = json_decode($received_data);
require_once('login.php');
.
.
//Connect to database and send query
.
.
$data_requested = json_encode($data);
echo $data_requested;
I tried to do similar like this link:http://www.cleverweb.nl/javascript/a-simple-search-with-angularjs-and-php/
but its still not working. Anybody has any idea? Thank you