I'm having trouble accessing the index value inside the templateRef. It shows as undefined in the console.
<ng-container *ngFor="let notification of notifications; let i = index">
<ng-template
*ngTemplateOutlet="notificationPageContent; context: { notification: notification, index: i }">
</ng-template>
</ng-container>
<ng-template #notificationPageContent let-notification=notification let-index=i>
While I can access the notification value without any issues, I am not able to access the index value. Can someone please assist me with this?
****Update**
<ng-template #notificationPageContent let-notification=notification let-index=i>
<notification
(notificationClosed)="notificationCloseHandler($event, i)"
>
Even after making these changes and clicking the button triggering the notificationClosed
function, the i
value still remains undefined. What could be causing this issue?