O'Reilly logo

Professional ASP.NET MVC 5 by David Matson, K. Scott Allen, Brad Wilson, Jon Galloway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required