My Angular UI is Slow

SupaDupaGuides
1 min readApr 9, 2021

Are you making this one mistake that makes your UI laggy and unresponsive?

When you interact with your Angular UI is it jerky & slow to update?

One of the top causes of this is that you reload your data after every interaction.

Given an interactive table in the UI…

You click “Add Row”, for example — this posts to the server and adds a row to the data. You then request the new table data & render it on screen.

This may be ok for a few rows, but when you get to 50 rows the UI will be laggy.

So what's that antidote?

Localize the data.

Sure send the async update to the server, but don’t wait for the response. Just keep a local copy of the rows array and immediately update it on-click. Done.

If you need to access some of the server response, then wait for a page reload or request it when you actually need it.

Otherwise, the user will feel frustrated using your app.

--

--