Displaying threads

A user must know in which conversation he/she is participating, so we need to display this information to the user. To do so, we are going to implement a thread listing component.

Thread component

In order to display a list of threads, we are going to use a component for each thread to encapsulate all the information displayed to the user and functionalities. To create the desired component, follow these steps:

  1. Create the component file, called public/src/thread/thread.component.ts.
  2. Import the necessary dependencies:
    import { Component, OnInit } from 'angular2/core';
    import { RouterLink } from 'angular2/router';
    import { ThreadService } from '../services/thread.service';
    import { Thread } from '../datatypes/thread';
  3. Add the component ...

Get MEAN Blueprints 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.