Back to Browse

Hacker News Clone in AngularJS - Post 5, Part E: Adding All Related Comments to Post Show Page

37 views
Sep 24, 2016
4:25

http://becomingaprogrammer.com/nested-components-hacker-news-clone-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. http://becomingaprogrammer.com/nested-components-hacker-news-clone-angularjs-part-5/ In this video, we're going to ... make sure that we're displaying all of the comments related to a particular post by adding an ng-repeat. To do this, this video covers the following topics: * adding vm.comments to the StoryController and setting it equal to the value of the "kids" property retrieved from the Hacker News API's reponse data. * adding {{ vm.comments }} to the story-comments.html view to display the array of comment IDs * checking http://localhost:8080/#/post?id=1 to make sure that the array is passed to the view * using an ng-repeat to loop through vm.comments and pass each id into a story-comment component within each list item. * checking http://localhost:8080/#/post?id=1 again to see that we now have all the comments related to the 1st post on Hacker News.

Download

1 formats

Video Formats

360pmp46.1 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Hacker News Clone in AngularJS - Post 5, Part E: Adding All Related Comments to Post Show Page | NatokHD