var app = angular.module('myApp', ['ridge-speedometer']);
app.controller('customersCtrl', function($scope, $http, $timeout) {
$scope.getData = function(){
$http.get('asd.php').then(function (response) {
$scope.myData = 33; ////////// response.data
});
};
// Function to replicate setInterval using $timeout service.
$scope.intervalFunction = function(){
$timeout(function() {
$scope.getData();
$scope.intervalFunction();
}, 1000)
};
// Kick off the interval
$scope.intervalFunction();
Hi guys, as you see the codes above, I just have problem that line:
$scope.myData = 33;
$scope.myData = response.data"
when I'm writing 33 to the variable it works, but with "response.data". It isn't working. How can I get the value of my JSON.
This is my JSON page
[{"value":"23"}]
I have to get this 23
Thanks.