I have a ngtemplate which is neccessary for a modal I am creating a name-button(for modal) pair in each paragraph tag and want to create dynamic content for the modal
<ng-container *ngFor="let student of students">
<p>{{student.name}} <button (click)="modalService.show(modalContent)"> </p>
<ng-template #content>
.... for listing all details under student like student.roll, student.gender
</ng-template>
</ng-container>
but since I loop around with the same #content, it recognized for the first time and wont continue to create the template for the id, understandable one.
@ViewChild('content',{static: false}) modalContent: TemplateRef<any>;
so the ngtemplate content is mapped to the above modalContent modelService is a custom service which takes in a TemplateRef.
Ideally I want help in making multiple ngtemplate and mapping with the modalContent
I need a way to access these elements by setting a name tag to i, may be like a dictionary with the string:template