Ok, so this seems simple enough but evidently i'm missing something, and i've given up trying to understand what, my code goes something like this:
on my php side I read info from MySql database and it returns a json encoded object as such:
$rows = array();
while($row = mysqli_fetch_assoc($result)) {
$rows[]=$row;
}
echo json_encode($rows);
on to my Angular javascript side, I attempt to load the contents of this array into an array i have created in the scope of one of my controllers (i have 2)
$scope.CurrentOIDs=[];
$scope.populate = function () {
$.ajax({
type: 'GET',
url: 'getOidJSON.php',
data: {criteria: '', archived: 'NO'},
success: function (phpmarkup) {
$scope.CurrentOIDs = JSON.parse(phpmarkup);
console.log($scope.CurrentOIDs);
}
});
};
!when checking the console, the information shows up perfect, i get an array of 50 elements and all the info is there exactly how i need it as can be seen in the image here -> 1
i try to put all my data in a table using the following html,
<div id="quicksearchresults" ng-controller="EditableRowCtrl" data-ng-init="populate()">
<div id='searchResults'>
<table id='resultstable'>
<thead>
<tr style='background-color:#333333; color:whitesmoke;' class='headers'>
<th style='white-space: nowrap;' class='sort' data-sort='OIDid'>OID#</th>
<th style='white-space: nowrap;' class='sort' data-sort='priority'>Priority</th>
<th style='white-space: nowrap;' class='sort' data-sort='topic'>Topic</th>
<th style='white-space: nowrap;' class='sort' data-sort='category'>Category</th>
<th style='white-space: nowrap;' class='sort' data-sort='task'>Task</th>
<th style='white-space: nowrap;' class='sort' data-sort='added'>Added</th>
<th style='white-space: nowrap;' class='sort' data-sort='target'>Target</th>
<th style='white-space: nowrap;' class='sort' data-sort='owner'>Owner</th>
<th style='white-space: nowrap;' class='sort' data-sort='remarks'>Remarks</th>
<th style='white-space: nowrap;' class='sort' data-sort='status'>Status</th>
</tr>
</thead>
<tbody class='list'>
<tr ng-repeat='task in CurrentOIDs'>
<td class='OIDid'>{{ task.OIDid }}</td>
<td class='priority'>{{ task.Priority }}</td>
<td class='topic'>{{ task.Topic }}</td>
<td class='category'>{{ task.Category }}</td>
<td class='task'>{{ task.Task }}</td>
<td class='added'>{{ task.Added }}</td>
<td class='target'>{{ task.Target }}</td>
<td class='owner'>{{ task.Owner }}</td>
<td class='remarks'>{{ task.Remarks }}</td>
<td class='status' style='font-size:150%; font-weight:bold;'>{{ task.Status }}%</td>
</tr>
</tbody>
</table>
</div>
</div>
now i know this works when i manually give the same exact values to the array in my javascript instead of reading them from the database. the one difference i did note, is that each object has a field added to it $$hashkey, but as far as i can understand this is added because of the ng-repeat.
My knowledge of angular is still basic, and i have no idea why this is not working, and have run out of stuff to search on google for it. ANY and ALL help is greatly appreciated. thank you.