I am attempting to replace the angularjs POST request with a standalone JSON response string.
Previously, the angular GET / POST requests would automatically convert the response to JSON which worked perfectly.
Now, I am trying to store the JSON response as a javascript string variable within the controller and then parse it using JSON.stringify()
and subsequently utilizing JSON.parse()
.
There are no errors, however, I am unable to access the member variables of the resulting JSON object using the .
operator
var staticData = '{"someKey":"someValue", "masterJobs":[]}'; //very large json string.
var resultString = JSON.stringify(staticData);
$scope.staticTestData = JSON.parse(resultString);
console.log($scope.staticTestData.masterJobs); // this displays 'undefined'
The controller function containing the large JSON can be found here.