I'm trying to get data from a REST service and display the elements in the browser. Piece of code:
Server.prototype.typeNames = function() {
var json = '{'
+ '"query" : "MATCH n RETURN n.typeName LIMIT 10"'
+ '}';
$http.post("http://localhost:7474/db/data/cypher", json).then(function(response) {
var data = response.data;
console.log(data);
return data;
});
}
I'm sure the JSON and the REST call are correct because I can see the data in my console and it's correct but I can't see it on the page. I have also this in my js file:
$scope.typeNames = Server.typeNames()
In HTML:
{{typeNames}}
Also: I install AngularJS debug extension for chrome and there it's also null:
typeNames: null
Here (http://pastebin.com/itHv97da) you can find a bigger part of code. This code is not mine, the Server.prototype things were all there. I just added the Server.prototype.typeNames and I'm trying to get it to work.