Greetings! I am currently working with dynamic data that is being displayed in the form of buttons. Below you will find the code snippet:
<ng-container *ngFor="let data of mapData">
<div *ngIf="data.OrderState==='1'" class="ds">
<button [id]="data.DrId" class="btn btn-outline secondary">
{{data.Name}}
</button>
</div>
</ng-container>
Now, after clicking the dynamically generated button, I want to send the data.Drid and data.Name to the modal input fields. How can I call the modal on a dynamic button click, pass these as two parameters, and retrieve that data on the modal's submit button?
Here is the Bootstrap 4 modal code. How can I apply it to send parameters to this modal?
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>