<div *ngFor="let task of data ; let i = index" [attr.data-index]="i">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">
Open modal
</button>
<div class="modal fade" id="{{task.id}}">
//HTMl Content
</div>
</div>
In the above code I am unable to add the data-target Dynamically for the button. i have gone through this but this is modifying for all the modals at once only and having same name.
Thanks for your Help in advance.