What is a single-page application (SPA)?
Model answer
A single-page application loads one HTML page and then updates the content in the browser with JavaScript as the user moves around, instead of asking the server for a full new page each time. Angular does this with its router: changing the URL swaps the components shown on screen.
The benefits are a faster, app-like feel after the first load. The costs are a heavier first download and extra work for search engines, which is why server-side rendering is often added for public pages.
Tips
- Mention the trade-off, not only the benefit.
Learn this topic
Angular Tutorial: Beginner to Advanced .
Sign in to add your own answer.
More questions
- What is Angular, and how is it different from AngularJS?
- What does the Angular CLI do? Name some common commands.
- What is a standalone component, and why did Angular move away from NgModules?
- What is TypeScript, and why does Angular use it?
- Describe the structure of a basic Angular project.
- What happens when an Angular application starts?