# Dynamic binding slow!

**URL:** <https://forum.ionicframework.com/t/dynamic-binding-slow/89347>\
**Category:** ionic-v3\
**Created:** [May 8, 2017, 9:38am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347 "2017-05-08T09:38:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![HarinderSingh](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@HarinderSingh](https://forum.ionicframework.com/u/HarinderSingh)\
**Post date:** [May 8, 2017, 9:38am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347/1 "2017-05-08T09:38:12Z")

</div>

Hello can anyone tell me how to fast dyamic bibding in ionic 2,  
If i am doing statically by adding ion list and ion items, even if I add 400 items it is fast.  
But when I bind from json file and put json data in array and iterate ion list over that loop. It shows items after some time like 4 seconds. How to fast it as static items? Any solution? Quick one…

---

<div class="post-metadata">

**Author:** ![chillax](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/chillax/32/70128_2.png) [@chillax](https://forum.ionicframework.com/u/chillax)\
**Post date:** [May 8, 2017, 9:53am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347/2 "2017-05-08T09:53:59Z")

</div>

Perhaps you can provide a code sample of what you are currently doing?

---

<div class="post-metadata">

**Author:** ![HarinderSingh](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@HarinderSingh](https://forum.ionicframework.com/u/HarinderSingh)\
**Post date:** [May 8, 2017, 9:58am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347/3 "2017-05-08T09:58:44Z")

</div>

```auto
   <ion-list *ngFor="let item of data">
      <ion-item no-lines id="English{{item.Time}}" [hidden]="!settingsData.showEnglish" [ngStyle]="{'font-size': settingsData.fontSize+'px','color':settingsData.fontColor}">
                {{item.EnglishItem}
            </ion-item>
        
        </ion-list>

```

in .ts file add json file to an array  
`this.data = data.json();`

Items are more than 500 of lines. I thinlk that’s why it is slow!

---

<div class="post-metadata">

**Author:** ![chillax](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/chillax/32/70128_2.png) [@chillax](https://forum.ionicframework.com/u/chillax)\
**Post date:** [May 8, 2017, 10:11am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347/4 "2017-05-08T10:11:59Z")

</div>

Don’t know if it will change that much, but the ngFor should be placed on the item, not on the ion-list. Unless you want to generate a list and item for all items in the array you are looping over.

---

<div class="post-metadata">

**Author:** ![HarinderSingh](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@HarinderSingh](https://forum.ionicframework.com/u/HarinderSingh)\
**Post date:** [May 8, 2017, 10:18am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347/5 "2017-05-08T10:18:43Z")

</div>

No this will not work, I have to iterate on ion-list. Item contents are different.

---

<div class="post-metadata">

**Author:** ![chillax](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/chillax/32/70128_2.png) [@chillax](https://forum.ionicframework.com/u/chillax)\
**Post date:** [May 8, 2017, 10:30am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347/6 "2017-05-08T10:30:05Z")

</div>

Uhm. The item variable should be available on the ion-item when doing:

`<ion-item *ngFor="let item of data" [id]="'English' + item.Time">{{item.EnglishItem}}</ion-item>`

unless I misunderstand your intent.

Also, I guess you have factored in the time it takes to fetch these items from the server?

---

<div class="post-metadata">

**Author:** ![HarinderSingh](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@HarinderSingh](https://forum.ionicframework.com/u/HarinderSingh)\
**Post date:** [May 8, 2017, 10:31am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347/7 "2017-05-08T10:31:47Z")

</div>

> [@chillax](#):
>
> \<ion-item \*ngFor=“let item of data” [id]=“‘English’ + item.Time”\>{{item.EnglishItem}}\</ion-item\>

No It is local json file.

---

<div class="post-metadata">

**Author:** ![chillax](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/chillax/32/70128_2.png) [@chillax](https://forum.ionicframework.com/u/chillax)\
**Post date:** [May 8, 2017, 10:40am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347/8 "2017-05-08T10:40:29Z")

</div>

Sorry, my bad. Sound very weird. So the file load itself is fast? Have you tried removing all but the {{item.EnglishItem}} inside the ion-item? Just to see if the ngStyle influences anything.

---

<div class="post-metadata">

**Author:** ![HarinderSingh](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@HarinderSingh](https://forum.ionicframework.com/u/HarinderSingh)\
**Post date:** [May 8, 2017, 11:00am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347/9 "2017-05-08T11:00:02Z")

</div>

> [@chillax](#):
>
> {{item.EnglishItem}}

Let me check it bro 🙂

---

<div class="post-metadata">

**Author:** ![chillax](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/chillax/32/70128_2.png) [@chillax](https://forum.ionicframework.com/u/chillax)\
**Post date:** [May 8, 2017, 11:37am UTC](https://forum.ionicframework.com/t/dynamic-binding-slow/89347/10 "2017-05-08T11:37:25Z")

</div>

Also what browser is this in?

I see this issue is still open: [https://github.com/angular/angular/issues/8112](https://github.com/angular/angular/issues/8112)

Have you also tried enabling prodMode for angular and check if it makes a difference?
