Is Angular.js Just for Single Page Applications (SPA)

We are looking at options to build the front end of an application we are creating and are trying to evaluate a tool that will work for us and give us the best platform to move forwards.

This is a Node.js project Our initial plan was to use Express and go down that route but we decided that before we kick off this stage it might be best to review what is out there. Our application has several areas which we don't believe fit the single page model in that they are related from an application perspective but not from a view one.

We have seen a few of the frameworks we could use to build out the client like Backbone, Meteor etc and also Angular.js.

This may be a fairly obvious question but we cannot seem to decipher if angular.js is purely for single page applications or it can be used for multi page applications like Express for instance.

UPDATE 17 July 2013 Just to keep people in the loop, i will be updating this question as we go through the process. We are going to build everything together for now, and we will see how well that performs. We have reached out to a few people who are more qualified with Angular then us and posed the question regarding splitting up larger apps that share context but may be too large working on a single page.

The consensus was that we could serve multiple static pages and create Angular apps that work with only those pages, effectively creating a collection of SPA and linking those apps together using standard linking. Now our use case is very specific in our solution has several apps, and as i said we are going to try the single code base first and optimise from there.

Not at all. You can use Angular to build a variety of apps. Client-side routing is just a small piece of that.

You have a large list of features that will benefit you outside of client-side routing:

  • two-way binding
  • templating
  • currency formatting
  • pluralization
  • reusable controls
  • RESTful api handling
  • AJAX handling
  • modularization
  • dependency injection

It's crazy to think that all of that "could only be used in a single page app". Of course not.. that's like saying "Jquery is only for projects with animations".

If it fits your project, use it.

I struggled with the "how" at first with Angular as well. Then one day it dawned on me: "It is STILL javascript". There are a bunch of examples on the ins-and-outs of Angular (one of my favorites along with the book https://github.com/angular-app/angular-app). The biggest thing to remember is to load in the js files just like you would in any other project. All you have to do is make sure the different pages reference the correct Angular object (controller, view, etc.) and you are off and running. I hope this makes sense, but the answer was so simple I overlooked it.