For my UI.Bootstrap accordion, I have set up the heading as follows:
<accordion-group ng=repeat="(cname, stations) in byClient">
<accordion-heading>
{{ cname }} <span class="pull-right"> {{ Object.keys(stations).length }} Stations</span>
</accordion-heading>
However, when this is displayed, Object.keys(stations).length
does not return any value. Strangely enough, if I place the same length call in my controller, it works and returns the expected count. Is there a reason why the method call isn't working in AngularJS?
The rest of the accordion that uses stations
functions properly, indicating that the data is being populated correctly. Here is an example structure of the byClient
data:
{
"Client Name" : {
"Station Name": [
{...},
{...}
]
}
}