Building a Hacker News Clone in AngularJS – Part 5

Hi Everyone! I’m Dakota Lee Martinez. In this video series I’ll be using the Hacker News API to build out a Hacker News Clone in AngularJS.

These videos are accompanied by a series of blog posts at becomingaprogrammer.com. You can find the written explanation of the process and code samples there.

Building a Hacker News Clone in AngularJS – Part 5

In this video, we’re going to … add links between the Top Stories State and the Individual Post Show Page.

This video covers the following topics:

* adding an anchor link to the header at the top of the post show page template (story-comments.html) linking back to the top stories view.
* adding an anchor link around the ng-pluralize directive that displays the number of comments in the story.html Story directive template.
* discussing how the id of the post is passed around from the Story directive element in our top-stories.html view into our Story Directive’s controller, and then into the Story directive template in views/story.html
* explaining how we can use angular ui router to make a link to the post’s show page to show the post with that id
* giving the anchor link a blank href attribute and a ui-sref attribute equal to “post({ id: {{ vm.id }} })”
* loading http://localhost:8080/#/top to make sure that both links are working

source