Chapter 12Single Page Applications with AngularJS
—by K. Scott Allen
What's In This Chapter?
- Understanding and installing AngularJS
- How to build the Web API
- How to build applications and models
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
You can find the wrox.com code downloads for this chapter at http://www.wrox.com/go/proaspnetmvc5 on the Download Code tab. The code for this chapter is contained in the following file:
AtTheMovies.C12.zip
In this book we've demonstrated how to combine jQuery and ASP.NET MVC 5 to build web pages that are interactive. jQuery is a great library, but you can only go so far with jQuery. As a library, jQuery gives you the ability to select DOM elements, manipulate DOM elements, wire up events, and communicate with the web server, but it doesn't provide any structure, patterns, or abstractions to address a true client-side HTML 5 application.
An HTML application (what some people would call a single page application, or SPA) is a complex beast. The typical browser application must manage data by requesting raw JSON data from the server and transforming the JSON into HTML, as well as retrieve input from UI controls on a page and push the input data into JavaScript objects. The typical browser application also manages multiple views by loading pieces of HTML into the DOM, which also requires the application to manage browser history for the back and forward buttons to work. With all this work to do on the client, you need to separate concerns like ...
Get Professional ASP.NET MVC 5 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.