# Ng-repeat : display only the first element, why?

**URL:** <https://forum.ionicframework.com/t/ng-repeat-display-only-the-first-element-why/75791>\
**Category:** ionic-v3\
**Created:** [January 10, 2017, 5:57pm UTC](https://forum.ionicframework.com/t/ng-repeat-display-only-the-first-element-why/75791 "2017-01-10T17:57:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![spectral](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@spectral](https://forum.ionicframework.com/u/spectral)\
**Post date:** [January 10, 2017, 5:57pm UTC](https://forum.ionicframework.com/t/ng-repeat-display-only-the-first-element-why/75791/1 "2017-01-10T17:57:41Z")

</div>

Hi,

I have the following html code:

```
	<a ng-repeat="filter in imageFilters">
	<p>{{ name }}</p>
	<img id="{{id}}" class="img-filter" [src]="image">
    </a>

```

and the following .ts file.

```
@Component({
selector : 'photo-filter',
templateUrl: 'photo-filter.html'

```

})  
export class PhotoFilter {

```
image : any;

imagesFilters = [
		{
		name : 'Normal',
		id : 'normal'
		},
		{
		name : 'Claredon',
        id : 'claredon'
		},
		{
		name : 'Gingham',
        id : 'gingham'
		}	
];

constructor(private navParams: NavParams) {

this.image = this.navParams.get('base64');

}

```

}

But only one image is displayed, and no name is displayed.

I’m a newbie, so can you let me know what the issue is ?

Thanks

---

<div class="post-metadata">

**Author:** ![r7sy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/r7sy/32/105602_2.png) [@r7sy](https://forum.ionicframework.com/u/r7sy)\
**Post date:** [January 10, 2017, 7:06pm UTC](https://forum.ionicframework.com/t/ng-repeat-display-only-the-first-element-why/75791/2 "2017-01-10T19:06:07Z")

</div>

Try it like this  
`<a *ngFor="let filter of imageFilters"> <p>{{ filter.name }}</p> <img id="{{filter.id}}" class="img-filter" [src]="image"> </a>`  
also you should consider wrapping your links in an ion-list .

---

<div class="post-metadata">

**Author:** ![spectral](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@spectral](https://forum.ionicframework.com/u/spectral)\
**Post date:** [January 10, 2017, 8:02pm UTC](https://forum.ionicframework.com/t/ng-repeat-display-only-the-first-element-why/75791/3 "2017-01-10T20:02:32Z")

</div>

Thanks,

But with this code, nothing is displayed ☹

Any suggestion ?

---

<div class="post-metadata">

**Author:** ![r7sy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/r7sy/32/105602_2.png) [@r7sy](https://forum.ionicframework.com/u/r7sy)\
**Post date:** [January 10, 2017, 8:24pm UTC](https://forum.ionicframework.com/t/ng-repeat-display-only-the-first-element-why/75791/4 "2017-01-10T20:24:34Z")

</div>

How about this  
`  
\<ion-item \*ngFor=“let filter of imageFilters”\>

{{ filter.name }}

 ![]() `

---

<div class="post-metadata">

**Author:** ![spectral](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@spectral](https://forum.ionicframework.com/u/spectral)\
**Post date:** [January 10, 2017, 8:29pm UTC](https://forum.ionicframework.com/t/ng-repeat-display-only-the-first-element-why/75791/5 "2017-01-10T20:29:13Z")

</div>

Thanks…

But nothing is displayed ☹

How is it possible ?

---

<div class="post-metadata">

**Author:** ![r7sy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/r7sy/32/105602_2.png) [@r7sy](https://forum.ionicframework.com/u/r7sy)\
**Post date:** [January 10, 2017, 8:39pm UTC](https://forum.ionicframework.com/t/ng-repeat-display-only-the-first-element-why/75791/6 "2017-01-10T20:39:23Z")

</div>

Weird , the second reply is a code snippet I use frequently , perhaps someone else could notice the problem and shed some light on the matter .

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [January 10, 2017, 8:45pm UTC](https://forum.ionicframework.com/t/ng-repeat-display-only-the-first-element-why/75791/7 "2017-01-10T20:45:20Z")

</div>

`imageFilters` != `imagesFilters`.
