I figured out my problem. I was constructing the JSON wrong. I am going
to construct the multi-dimensional array with text formulas after all. I
didn't have any luck pushing sub arrays into the array in PHP, then
converting it back to JSON with JavaScript in the front end. I'm going to
add a counter as the array key, then a colon, then a comma at the end in a
for loop:
$oneStoreListing = "\"" . $forCntrStore . "\":" . trim($oneStoreListing) .
",";
//Keep adding single store listings to the array until the loop
is done.
$storeListingsData = $storeListingsData . $oneStoreListing;
Then when the entire array is created, I need to strip the comma off the
end, and add a curly brace:
$storeListingsData = substr($storeListingsData,0,-1);
$storeListingsData = "{" . $storeListingsData . "}";
I'm not getting an error from angularjs, and javascript JSON is converting
the array in string format to an object for angularjs:
data = JSON.parse(data);
Creates an object for angularjs.
On Friday, May 16, 2014 12:17:21 AM UTC-4, Trash Match wrote:
>
> I just found out that my JSON was not right after all. I had an extra
> curly brace at the beginning of every sub array. That is part of my
> problem.
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.