#ngModel load issue

2 messages · Page 1 of 1 (latest)

edgy musk
#

Hi guys, quick question

  <tbody>
            <tr *ngFor="let imageURL of filteredImages">
                <td>
                    {{ imageURL.id}}
                </td>
                <td>
                    <img [src]='imageURL.image'>
                </td>
            </tr>
        </tbody>```

 So when I am using the ngFor directive it at first does not load any of these images... it remains blank. Then when I type input it will load all 3 images, or filter the images based on what I type 
Just wondering what this stale / incorrect load could be due to. Maybe my default value that I'm filtering for? It's just set to an empy string though

```html
<input type="text" [(ngModel)]='filter' /> 

Maybe its more of a ngModel issue actually

prisma heart
#

If you're using filter string for the. filteredImages array it could be giving 0 matches, thus not rendering any. For the default array you should have all the items in array and once you start typing filter them.