In my application, I am making multiple API calls and caching the data for future use. When someone else interacts with the app, I want to retrieve that cached data and display it in a drop-down using ng-option. To access the cached data for each call, I am using the following code:
var httpCache = $cacheFactory.get('$http');
var cachedImpactedEntities = httpCache.get('my api url');
The returned data is an object containing an array nested within another array, structured like this:
[200,"[ {
"entity_id": 1,"entity_desc": "test1" },
{"entity_id": 2,"entity_desc": "test2"}]",
{"content-type":"application/json;
charset=utf-8"},"OK"]
I'm looking for a way to extract only the nested array in quotes and display each "entity_desc" value in the drop-down using ng-option, like this:
test1
test2
...
The format of the cached information is causing confusion for me.
Appreciate any help on this matter.