I am trying to take a look at AngularJS, with a cf backend
I have the following code that pulls a regular cfquery called getIndex which pulls five rows of columns each (firstName, lastName)
var theQuery = <cfoutput>#serializeJSON(getIndex,true)#</cfoutput>;
var theData = theQuery.DATA
function dataLooper($scope){
$scope.people = theData;
console.log($scope.people);
}
the console log produces
Object { FIRSTNAME=[5], LASTNAME=[5]}
my html looks like
<div ng-controller="dataLooper">
<div ng-repeat="person in people">
{{person}} - {{person.FIRSTNAME}}<br>
</div>
</div>
which produces
["Yasteel","Kyleigh","Gary","Nick","Kerry-Leigh"] -
["Si","No","Ho","Ga","Gr"] -
Obviously I am missing something as this isn't what I expected at all. I am guessing that it is because AngularJS is looking for an Arrray instead of an object. I am not sure but I was hoping that serializeJSON would give me some type of usable object without a lot of extra manipulation. Can someone point me in the right direction?