API parsing
Posted: Fri Jan 03, 2020 7:22 pm
Hello! I can’t make parsing json work, I’m trying for the second day and no way.
this code reads from another site does not output anything from zm
no error, empty output, please tell me how to do it right?
Code: Select all
angular
.module('app.widgets')
.controller('ZoneminderController', function ($http, $scope) {
var url = 'http://192.168.1.8/zm/api/events.json?auth=781baeb20af76a298882abcf631b16c3';
$scope.data = [];
function loadData() {
$http.get(url)
.then(function (response) {
$scope.data = response;
})
.catch(function(error) {
$scope.error = error;
});
}
loadData();
});
no error, empty output, please tell me how to do it right?
Code: Select all
http://192.168.1.8/zm/api/host/getVersion.json
{
"version": "1.32.3",
"apiversion": "1.0"
}