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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access