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:
Open your terminal and navigate to the project directory.
Run the following command from inside the project directory:
ng g c posts/containers/posts
Open the
src/app/posts/posts-routing.module.ts
file.Import the
PostsComponent
:import { PostsComponent } from './containers/posts/posts.component'
Add the following route to the
routes
array:{ path: '', component: PostsComponent },
Now when we refresh the page in our app, we should see the text posts works! between our header and footer:
Very similar to how...