This project aims to showcase Oracle PL/SQL records on a website. I followed the steps outlined in this tutorial () to establish a connection with the database. While I successfully stored and displayed values for a single record, I encountered difficulties when attempting to add multiple records.
Example JSON Data
[
{ "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 implementation utilizes a factory to handle the data from the JSON, but I'm struggling to store more than one record at a time. My goal is to iterate through the records as shown in this example: http://jsfiddle.net/pJ5BR/124/.
I welcome any suggestions or guidance on how to tackle this issue. Below are the current definitions of the factories:
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;
});
}]);