Display comments on postPage
- Create unordered list to display all comments for each postPage
- Iterates through comments related to postItem and display the comment using Spacebars
- Need to create helper to find all comments related to specific post on the postPage
Add template helper for postPage comments
- Template helper will pass comments variable to postPage template
- comments variable is a function that returns all comments related to the post on the page
- Post is identified using the _id of the current post on the page
Create comment template
- Create new directory in client/views called comments and add comment template within that directory
- Comment template contains a list item and h4 which contains the authors name and the submitted text
- Below that is the body of the comment
Add template helper for comments
- Template helper for comment will pass variable submittedText to the comment template
- submittedText is a function that returns the date of the comment in a human-readable format
- The submitted date is stored as UNIX timestamp
Display number of comments on each post
- commentsCount will be a number which corresponds to the number of comments on a certain post
- Clicking on this will lead users to the corresponding postPage
Add commentsCount to post item template helper
- commentsCount is a function that finds all comments related to a post based on post _id and counts the number of comments found
- commentsCount is passed to the postItem template so it can display the number of comments in a certain post
Merge pull request #25 from alexanderdavidpan/Display_Comments_On_postPage

Display comments on post page