O'Reilly logo

Node.js, MongoDB, and AngularJS Web Development by Brad Dayley

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

Implementing the Photo View

The photo view, shown in Listing 27.11, is the main view for the application in this example. It is loaded at the root route, /. The header of the view registers the <html> element with the AngularJS application and loads the comment_styles.css file. The <body> element is broken down into two main sections.

The upper section initializes the AngularJS ng-controller="photoController" to provide the functionality to interact with the photos from the webserver, including comments on photos. The lower section initializes ng-controller="photoController" to provide the functionality to interact with the webpage comments. You use two controllers to keep the scope separate because both are implementing comment sections.

The ...

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