how to fixed this ERROR TypeError: Cannot read properties of undefined (reading 'length') in...

Discussão em 'Angular' iniciado por keshav godani, Dezembro 2, 2024.

  1. Why is the categoryJobLists.length given the error ERROR TypeError: Cannot read properties of undefined (reading 'length')

    <ion-content>

    <div *ngIf="categoryJobLists && categoryJobLists.length > 0">
    <ion-grid>
    <ion-row *ngFor="let categorysJobs of categoryJobLists">
    <ion-col size="6" (click)="openJobDetailPage(categoryJobLists)">
    <ion-card>
    <ion-card-header>
    <ion-card-title> {{categorysJobs.job_title}} </ion-card-title>
    <ion-card-subtitle>Total Opening: {{categorysJobs.total_vacancies}} </ion-card-subtitle>
    </ion-card-header>

    <ion-card-content>
    Open from {{categorysJobs.apply_from_date}}
    </ion-card-content>
    </ion-card>
    </ion-col>
    </ion-row>
    </ion-grid>
    </div>

    <div *ngIf="categoryJobLists && categoryJobLists.length == 0">
    <ion-chip>
    <ion-icon name="close-circle-outline"></ion-icon>
    <ion-label>Not Found</ion-label>
    </ion-chip>
    </div>

    </ion-content>


    [​IMG]

    Continue reading...

Compartilhe esta Página