Implementing the Comment Thread View

As discussed in the previous section, the photo and main mage sections of the photos page use ng-include to include the comment_thread.html partial template shown in Listing 27.12. You break out the partial template so that you can later easily include it in other pages or even additional sections of the same page.

The partial template includes the CommentThread title, using {{commentThread.title}}. An <input> button toggles addComment to true, allowing the reply form to be displayed. (It is currently hidden using ng-show.) Inside the reply form, the subject <input> is defined, along with a comment body <textarea>, as shown in Figure 27.5. The Add Comment button executes the addReply() method in the scope ...

Get Node.js, MongoDB, and AngularJS Web Development 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.