In Angular, I have a FormArray with around 21 form controls per row. When I try to load and display 20,000 records, the UI freezes and the API response takes a long time to load and render the data.
Loading
In Angular, I have a FormArray with around 21 form controls per row. When I try to load and display 20,000 records, the UI freezes and the API response takes a long time to load and render the data.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Deepika SawantPosted Jul 5, 2025, 3:07 PM
Lazy Load Form Controls
Instead of creating all
FormGroups at once, create them on demand as the user scrolls or interacts.FormGroups only for visible rows.Use Template-Driven Forms for Read-Only Views
If the form is mostly for display and occasional edits:
FormGrouponly when the user clicks "Edit".Paginate the Data
Instead of loading 20,000 records at once:
Debounce and Throttle API Calls
If you're fetching data from an API:
debounceTime,switchMap, anddistinctUntilChangedto reduce load.Optimize Change Detection
ChangeDetectionStrategy.OnPushin your component to reduce unnecessary checks.