Reputation: 25
I am new to the Angular world and hope that this question makes sense:
Say I have a section under app.component.html:
<section id="zoo">Zoo</section>
Now I create another component (zoo) using the following command:
ng g c zoo
This will create 4 new files for zoo.
What I want now is to click on the section (zoo) that will redirect me to the created zoo-page and ONLY display the content for that page.
How can I do that?
Upvotes: 1
Views: 1053
Reputation: 26
First create a new route like this { path: 'zoo', component: ZooComponent }
.
Then change your html for <section id="zoo" routerLink="/zoo">Zoo</section>
Upvotes: 1