Angular + javascript - List objects recieved in response
I would like to have a button in a webpage, that when I click on it, a
list of objects from a DB will be displayed in screen.
the angular code is this:
in the angular controller:
$scope.list = function(){
$http.post("rest/data/list", $.param({}))
.success(function(data, status, headers, config) {
alert(data);
})
NOTE: I have a java function called list().
and in the html page:
<h3>Get all of your objects:</h3>
<button ng-click="list()" value="List strings">List strings</button>
So currently, when I succeed, I get an alert with: "[object
Object],[object Object]" (which looks ok because I do have 2 objects
there).
But how can I display the objects themselves (their values) in the page?
Thanks in advance
No comments:
Post a Comment