i have just started learning AngularJS and build a project using AngularJS ,Spring and Hibernate ,this project was an SPA(Single Page Application) and i have used REST interaction with server.Now i have another project to work on and using AngularJS would make the develoment of this project easier but this project is not an SPA and using REST would also make it manageable, i want to know for what requirements we switch to AngularJS , is it that only to make an SPA ?
-
https://stackoverflow.com/questions/11541695/redirecting-to-a-certain-route-based-on-condition In other words, you can use AngularJS for applications which are not SPA. – Prof. Falken Jan 16 '15 at 09:15
-
2Well..no. Every page could have angular bindings in them, why wouldn't they? – Patrick Jan 16 '15 at 09:15
-
1What is it you actually want to know? And when investigating this issue, what did you find out? – Patrick Jan 16 '15 at 09:20
-
As AngularJS provides a good support for REST ,but whenever i have used AngularJS it was an SPA , so this time i am unable to think that if its not an SPA , can REST still be implemented using AngularJS ? @Patrick – Alok Mishra Jan 16 '15 at 10:19
-
2The REST service is just the web server responding to a request and sending JSON or XML back. What makes you think that would be a problem requesting from more than one page? – Patrick Jan 16 '15 at 10:23
2 Answers
Absolutely not. AngularJS
has full support for the SPA concept (e.g. routing), but can be used to create individual pages in a larger app (or a small app for that matter) that have no direct relationship to each other.
AngularJS
fits in nicely with server side frameworks (e.g. ASP.net MVC
) which can be used for server-side routing and to render the initial page template. Angular can then take over once the initial page is loaded.
I have personally done this on several projects with great success.

- 3,541
- 3
- 38
- 67

- 27,544
- 21
- 86
- 147
-
1@Sandler: This has been the only **real** answer to the original question. The rest only try to defend Angular and nothing else. – Pap Jun 29 '15 at 14:02
-
1What is the necessity of using a server side MVC when you have angular? Can't we totally avoid ASP.NET MVC and use only web api and EF and build a perfectly good working application which is highly maintainable? – Giridhar Karnik Dec 07 '15 at 04:07
-
@GiridharKarnik As UI/UX is getting complex day by day client side MVCs just helps manage that complexity very well.Putting everything on client side has risk of getting business logic exposed. – Alok Mishra Jul 17 '17 at 06:59
It is true that Angularjs helps us to make great Single Page Application with less effort. Instead Angularjs can be used for normal webpage development. Angularjs can provide following advantages:
- Reduces amount of code, as Angularjs extends HTML page: Angularjs provide various in-built directive that helps code duplication. It also provide facility to create our own directive.
- Two-way Binding
- Dependency Injection
- Provide Rest Support apart from Single Page Application
- Template Features
Edit:
All this above features can be used in multiple page of your Web-Application, that you are working on. More Info

- 832
- 7
- 21