Building the comments component

The last missing piece of the puzzle for our commenting system is the comments component, which will list all the comments and provide the UI to create new comments:

The comments component allows users to add comments to projects

Let's use the Angular CLI to create the structure for our comments component:

ng generate component --spec false -ve none -cd onpush comments/comments/comments

First, let's edit the template of our comments component located in src/app/comments/comments/comments.component.html:

<div class="title">Add new comment</div><div class="add-comment-section">  <div #commentContentEditable class="add-comment-box" ...

Get Mastering Angular Components 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.