My controller retrieves a json array with only one index, which is a json string containing three properties: whiteLedvalue, blueLedValue, and variousColorLedValue.
The code in my controller looks like this:
function getLedData()
{
ledService.getLedData()
.then(function(response){
ctrl.ledData = response.data;
});
}
In the dashboard HTML file, I have the following:
<tr ng-repeat="led in ctrl.ledData">
<td> LED Value</td>
<td >
{{ led }}
</td>
</tr>
I want to separate the white values, blue values, and various color values into individual td elements. I attempted the following:
<tr ng-repeat="led in ctrl.ledData.whiteLedValue">
<td> LED Value</td>
<td >
{{ led }}
</td>
</tr>
However, it did not work as expected. I believe the issue lies in accessing the correct index within the array. I am unsure if I need to assign each value to its own variable (ctrl.whatever) or if there is a way to access them directly in the HTML. Any guidance on extracting these individual fields would be appreciated. Currently, my only successful method involves returning the entire json string.