Let's Stop Calling Angular a SPA Framework
Are Angular 2 and AngularJs (Angular 1) really SPA frameworks? Personally, I say no. That being said, I continue to hear it be lumped in with discussions solely focused on Single Page Application development.
I get it, AngularJs (Angular 1) road the same train that was started when the idea of a SPA got popular. At the time it had an intelligent approach that helped solve some problems associated with developing SPAs and packaged it together with additional functionality making it one of the most trusted and popular frameworks out there.
If we were to take a step back though and really ask ourselves what problems did SPAs introduce, we might start to see a clearer picture as to why lumping Angular in with only SPAs is not painting a clear picture of the framework.
Some of the more popular components of AngularJs are...
Out of this group I would argue the only one that can be identified as being more prevalent with the rise of SPAs is Routing. Routing alone though does not mean the use of Angular is best suited for SPA development. In fact, I believe it to be the opposite.
We Live In a World of Receptacles
At my day-to-day, we deal with large enterprise applications that require user interactions that are beyond the scope of SPAs. Even with that being the case, we hedged our bets on Angular early and it has since served us well. Angular helped shape "best-practice" patterns into our code, added rich interactions to our client apps and allowed us to all speak the same language when it came to designing and architecting our front-end apps.
When examining how we have had success with Angular in our projects, we quickly started to see that limiting its definition to that of SPAs does not accurately describe our application of Angular.
Instead of looking at it as one framework made up of multiple components resulting in a complete end to end user experience, we shifted our mindset a bit. We started to look at our front-end applications as a collection of receptacles that are made up of a number of components, of which include this framework.
These subtle but important mindset shifts helped our team look beyond the scope of the SPA architecture and allowed us to implement practices that considered problems reaching "further down the road". Code reuse was raised across the board and maintainability was bolstered from project to project.
What are your thoughts about typecasting AngularJs and Angular 2 to the definition of a SPA? Let me know in via the comments section below.