0
I have a php that delivers the following content
[{"Id":"50630","Operador":"","Id_cadastro":"61693"}]
Vue-Resource only recognizes if I remove the []
my code is
this.$http.get('data.json').then(function(response) {
this.cervejarias = response.data.Id_cadastro;
}
In PHP I’m doing so:
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){
$data[] = $row;
}
print json_encode($data);
I’m forgetting something?
This same json, I can read through Angular.
Something you can also do is exchange your PHP code for
print json_encode($smtm->fetchAll());
– Guilherme Pressutto
And to debug codes so you can use
console.log(response)
and see on your console how the data is coming.– Guilherme Pressutto
Just want to show a record of that JSON? Wouldn’t that be something like: http://jsfiddle.net/a312sa5a/ ?
– Sergio