SeventhWarhawk
SeventhWarhawk

Reputation: 1323

Cannot find name 'List'? (Ionic - Angular) when using ViewChild

I am receiving the aforementioned error when trying to use an ion-list in the following context:

My Imports:

import { AddNamePage } from './../add-name/add-name.page';
import { MainService, User } from './../services/main/main.service';
import { Component, OnInit, ViewChild} from '@angular/core';
import { ModalController } from '@ionic/angular';

I also have imported the ionic module into app.module.ts.

Usage:

 @ViewChild('myList', {static: false})myList: List;

The 'List' part is underlined, and it says "Cannot find name List" - I thought this would form part of the ionic module?

Integration:

<ion-list #myList>
    <ion-item-sliding *ngFor = "let item of users">
      <ion-item-options side="start">
        <ion-item-option style="background-color: #f55c47" (click)="deleteUser(item)" ><b>Delete</b></ion-item-option>
      </ion-item-options>

      <ion-item lines="full">
        <ion-icon name="person-sharp" slot="start"></ion-icon>
        <ion-label>{{item.title}} {{item.firstName}} {{item.secondName}}</ion-label>
      </ion-item>

      <ion-item-options side="end">
        <ion-item-option><b>Edit</b></ion-item-option>
      </ion-item-options>
    </ion-item-sliding>
  </ion-list>

What would the reason for this be?

Upvotes: 3

Views: 619

Answers (0)

Related Questions