I am trying to create an Angularjs collapse table with bootstrap, and I found this one Twitter Bootstrap Use collapse.js on table cells [Almost Done] does help me, especially the last comment using Angualrjs method.
However, I found this method doesn’t work on my Iphone safari browser but works on android phones. I can’t figure out the reason. Here is the example link http://jsfiddle.net/ADukg/6880/ which comes from the post above.
<div ng-controller="UserCtrl">
<h3>Click row to revel last name!</h3>
<table class="table table-condensed">
<thead>
<td>First Name</td>
</thead>
<tbody ng-repeat="user in users" on-finish-render>
<tr data-toggle="collapse" data-target="#{{user.id}}">
<td>{{user.firstName}}</td>
</tr>
<tr>
<td class="hiddenRow">
<div id="{{user.id}}" class="collapse">
<h4>{{user.lastName}}</h4>
</div>
</td>
</tr>
</tbody>
</table>
2
Answers
Try this instead
see : bootstrap 3 accordion collapse does not work on iphone
I think you should use
ng-repeat-start
andng-repeat-end
. native angularjs directivesCheck this link https://www.undefinednull.com/2015/04/10/repeating-multiple-elements-using-ng-repeat-start-and-ng-repeat-end-in-angularjs/
also, check this http://johnculviner.com/expandable-collapsable-detail-in-a-table-with-angular-js/
Sample
plunker for the above code