Muhammed Senussi
Muhammed Senussi
  • Muhammed Senussi
Resolvers or Loading States? It Depends Who Is AskingAngular

The two approaches are usually argued as a style preference. They have measurably different consequences.

Resolvers

The route does not activate until the data is there, so the first render is complete. That is exactly what you want for a prerendered or server-rendered page: the HTML a crawler receives contains the article rather than a spinner, and there is no layout shift when content arrives. The cost is a navigation that appears to hang if the request is slow.

Loading states

The page appears immediately with a skeleton. This feels faster on a slow connection and is right for anything behind a login, where nobody is indexing you and perceived responsiveness matters more.

What I do

Resolvers for public, indexable, server-rendered routes. Loading states for authenticated application screens. And a router-level progress indicator either way, because a navigation with no feedback for 400ms reads as a broken link regardless of which approach produced it.

0 Comments

  • No comments yet.

Leave a comment