The goal of this project is to display Oracle PL/SQL records in a web site. I have used the following tutorial (http://draptik.github.io/blog/2013/07/13/angularjs-example-using-a-java-restful-web-service/) to set up a connection with the database. I was able to store and display values for a single record, but not when more records were added in.
Sample JSON Information
[
{ "firstName":"FN1",
"lastName":"LN1",
"email":null,
"createdBy":-1,
"createdDate":"2013-09-24"
},
{ "firstName":"FN2",
"lastName":"LN2",
"email":null,
"createdBy":-1,
"createdDate":"2013-09-24"
},
{ "firstName":"FN3",
"lastName":"LN3",
"email":null,
"createdBy":-1,
"createdDate":"2013-09-24"
},
{ "firstName":"FN4",
"lastName":"LN4",
"email":null,
"createdBy":-1,
"createdDate":"2013-09-24"
},
{ "firstName":"FN5",
"lastName":"LN5",
"email":null,
"createdBy":-1,
"createdDate":"2013-09-24"
}
]
The example uses a factory, which I am convinced is holding the data from the json, but I can't get it to store more than the single record. Ideally, I would be able to cycle through the records the way they do in this example: http://jsfiddle.net/pJ5BR/124/.
I would appreciate any suggestions with this. These are how the factory is defined currently.
services.js:
services.factory('QueryFactory', function ($resource) {
return $resource('/Query/rest/json/queries/get', {}, {
query: {
method: 'GET',
params: {},
isArray: false
}
});
});
controllers.js:
app.controller('MyCtrl1', ['$scope', 'QueryFactory', function ($scope, QueryFactory) {
QueryFactory.get({}, function (QueryFactory) {
$scope.firstName = QueryFactory.firstName;
});
}]);