how can i increase the performance when rendering a template multiple times using ngFor? I have a situation where i need to show the same template based upon the count.I am doing this using *ngFor. The template loads correctly but i am worried about the performance.Because I need to repeatedly show the same content for a few thousand times,then the performance will be slow after the template is loaded.I have made a plunker demo here http://plnkr.co/edit/qTj4SVRnFD6N15PZ1GWC?p=preview . please Increase the count of formgroups in formarray with a difference of 1000 then the system will be slow or breaks down. This is how i create the formarray,
for(var i=0;i<100;i++){
let dummyFormGroup=this.fb.group({
'name':[''],
'place':['']
})
this.dummyFormArray.push(dummyFormGroup);
}
And i render the controls in formarray using ngFor like this
<div *ngFor="let formgroup of dummyFormArray.controls" style="display:flex;flex-direction:row">
<p>
<label>Name:</label>
<input type="text" [formControl]="formgroup.controls['name']" />
</p>
<p>
<label>Place:</label>
<input type="text" [formControl]="formgroup.controls['place']" />
</p>
Can somebody please suggest me an approach where i can increase the performance once the template is loaded? Because i am ok with waiting for the template to load if it needs to render thousands of records.But once the template is ready i want the system to be fast in this case using *ngFor. Somebody please help me in solving this issue. Thanks !