I would like to know how I can, when selecting a checkbox, take this data and throw it in a modal. In the code below, I want to pick only the selected charters from a post and make only those selected appear in the modal. How do I do? I've tried to see in other tutorials, but I could not find something to help me. Many thanks!
<div ng-repeat="charter in post.charters">
<input type="checkbox" ng-model="charter.selected"> {{'{{charter}}'}}
</div>
<div class="modal fade textfield" id="updatePopUp">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="exampleModalLabel" >Edit Post Components</h4>
</div>
<div class="modal-body">
<form>
<div class="form-group form-inline">
<label for="txtComponent" class="control-label">Component:</label>
<input type="text" class="form-control" ng-model="post.components" id="txtComponent" autocomplete="off" placeholder="Insert a component">
<button ng-click="searchCharters(post.components)" type="button" class="btn btn-primary">See charters</button>
</div>
</form>
<ul>
<div ng-repeat="charter in post.charters">
{{'{{charter}}'}}
</div>
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button ng-click="updatePost()" type="button" class="btn btn-primary">Update</button>
</div>