function PostsCtrlAjax($scope, $http)
{
$http({method: 'POST', url: 'ajax.php'}).
success(function(data)
{
$scope.orders = data; // response data
$scope.loading = true;
}).
error(function(data, status, headers, config) {
console.log(status);
});
function PostsCtrlAjax($scope, $http)
{
function queryData(){
$http({method: 'POST', url: 'ajax.php'}).
success(function(data)
{
$scope.orders = data;
$scope.loading = true;
}).
error(function(data, status, headers, config) {
console.log(status);
});
}
queryData();
setInterval(queryData, 1000);
}