I am trying to take a look at AngularJS with the cf backend
I have the following code that pulls out a regular cfquery called getIndex, which pulls out 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); }
in the console log is created
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 because it is not at all what I expected. I assume this is because AngularJS is looking for an Arrray instead of an object. I'm not sure, but I was hoping that serializeJSON would provide me with some kind of useful object without too much manipulation. Can someone point me in the right direction?
source share