This assignment will build off of assignment 1. Copy the files from assignment 1 into a new folder for assignment 2. DO NOT COPY THE FOLDER as this will copy over the
.git folder and tie this project to the GitHub repo associated with assignment 1. This should be a brand new repo.
In this assignment, you will update the Reddit search app so that all rendering of the search results is done through the Handlebars client-side templating library.
Rendering with Handlebars
Display a div for each subreddit post containing the following fields:
titlethat links to
urlin a new tab
subreddit_subscribersformatted with commas. Use a helper for this. To format a number, check out
num_comments> 0, show the number of comments, also formatted with commas. Otherwise, show “No comments”. Use the Handlebars
ifhelper. In Handlebars, 0 is treated as falsey.
If the user typed in an invalid subreddit name, the Reddit API will respond with a 404 HTTP response status code. This means that the subreddit can’t be found. If a user types an invalid subreddit into the search box and submits the form, display “Oops! Something went wrong!” on the page in red.
Create a repo on Github called itp404-assignment2-client-side-templating and upload your files. Send an email to the TA and myself with the Github URL. Failure to submit by the deadline will result in a 0.