dimanche 19 avril 2015

Not able to insert records generated by ng-repeat

I am trying to insert a record between records generated by ng-repeat. The insertion is based on satisfaction of a condition. However, when I try to do this, it comes either to the end of the row generated by ng-repeat or it comes before the first record generated by ng-repeat. I am not able to get the record between the records generated by ng-repeat. What is the problem here. Where am I going wrong? Below is the code snippet. Would appreciate any help. Thanks.



<div ng-controller='TreeCtrl'>
<div ng-init="init('<%= @angularParamsJSON %>')">
<h1>Manage content</h1>
<%= render :partial => 'page_header' %>
<%= render :partial => 'bread_crumbs' %>
<div ng-model="child_nodes"></div>
<%#= render :partial => 'page_footer' %>
<table class="table table-striped table-hover table-responsive">
<thead>
<tr>
<th>Details</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="(type, data) in tableContent"><td><button ng-click="show_children(type)" type="button" class="btn btn-primary">{{type}}</button>
<div class="inner-table">
<table ng-if="display[type]==true" class="table table-striped table-hover table-responsive">
<thead>
<tr ng-if="type!='Questionnaires'">
<th>Recipe Name</th>
<th>Directory</th>
<th>Creation Date</th>
<th>Updated Date</th>
</tr>
<tr ng-if="type=='Questionnaires'">
<th>Stages</th>
</tr>
</thead>
<tbody>
<tr ng-repeat-start="record in data" ng-click="showCellContent(record.name, record.directory)" class="clickable-row">
<div ng-if="type!='Questionnaires'">
<td>{{record.name}}</td>
<td>{{record.directory}}</td>
<td>{{record.creation_date}}</td>
<td>{{record.updated_date}}</td>
</tr>
<tr ng-repeat-end>something</tr>

</tbody>
</table>
</div>


</td></tr>
</tbody>
</table>
<div></div>

<!-- <button ng-click="get_children()" type="button" class="btn btn-default">Get</button> -->
</div>

Aucun commentaire:

Enregistrer un commentaire