Thanks for the replies! I could however not figure out the problem. I stumpled upon this question, and I thought this was the solution to my problem. However, this did not work either, I was able to get success from the $http.get
, but the factory
did not produce any data.
I am really clueless as to what the problem is, but I managed to do a "workaround" to get what I wanted; instead of doing the COUNT(*)
query, I used SELECT name FROM table
. Then I applied the json_decode
, and passed the array to $http.get
, which it would glady accept. Then I just found the length of the array like this:
$scope.count = 0;
count.success(function(data) {
$scope.count = data.length;
});
And now it works..
Thanks again!