Creating the Container Components

In this section, we will use ng generate to create the PostsComponent and ProfileComponent inside the PostsModule, add routes to both components, and add dummy data that we can use to build our presentational components.

Creating PostsComponent and ProfileComponent

We will be using the ng generate command to create our PostsComponent. This is the component that will eventually list an overview for all our posts.

The application route to this component will be /posts:

  1. Open your terminal and navigate to the project directory.
  2. Run the following command from inside the project directory:
    ng g c posts/containers/posts
    Creating PostsComponent and ProfileComponent
  3. Open ...

Get Beginning Server-Side Application Development with Angular 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.