Before answering the three questions I just want you to know what a SPA is.
Single page application (SPA) is a web application that fits on a single page. All your code (JavaScript, HTML, and CSS) is recovered with a single page stack. Further more, route between pages performed without invigorating the entire page.
Advantages of SPA:
No page flicker. Native application feel.
Client-side routing and data rendering on the client side.
Data from server is in JSON format.
Coming to the questions
1. Why is Angular called a single-page application?
Answer:
AngularJS is a full featured SPA framework, with the help of which a single page application is created. In the SPA, the whole page is not reloaded every time, only every time the view will be change.
So when you load the application for the first time, not all the pages from the server will be rendered... It's only index.html
that loads when you load the application. Since only a single page is loaded it is called SPA
2. Even if the URL changes in angular site will it be called SPA?**
Answer: Basically URL changes are done through routing. Routing in AngularJS is implemented by including <ng-view>
or <ui-view>
in your index.html
page without refreshing the entire page.
So when the URL changes it not the entire index.html that changes, only part of the HTML in ng-view or ui-view is switched between views.
3. Are all the sites created using Angular really single page applications? If not, why?
Answer: Yes. All the sites created with Angular are SPAs. AngularJS is defined in the SPA framework.