I am encountering an issue where the dayavailablescroll reference is showing as undefined in the ngAfterViewInit method.
<div class="shifts-rightTable " style="background-color: yellow" [ngClass]="{'tab-active':availData?.length}" >
<ng-scrollbar #dayavailablescroll [autoHeightDisabled]='false' track='horizontal'>
<table class="table" >
<tbody>
<tr *ngFor="let secondValue of availData;let s = index;">
<td>
<div class="shift-scheduleWrapper dayLeaveIcons" *ngFor="let thirdValue of secondValue.user_roster_data;let m = index;">
<div class="shift-scheduleList" [ngClass]="{'removeLeftspace':(thirdValue.day_status != 'Exchanged' && thirdValue.day_status != 'Scheduled' && thirdValue.day_status != 'Full day leave' && thirdValue.day_status != 'Exchange-Requested')}" [ngStyle]="{left:thirdValue.starTime + 'px',width: thirdValue.totalWidth + 'px'}" *ngIf="thirdValue.schedule_id && thirdValue.day_status != 'Holiday' && thirdValue.day_status != 'Weekend' && thirdValue.leave_status != 1 && thirdValue.day_status != 'Full day onduty'" (click)="$event.stopPropagation();setShow(s,m);closeOthers(s,m);selectedId = thirdValue.schedule_id;save...
typescript
Upon inspecting, the value of this.dayavailablescroll in ngAfterViewInit shows undefined.