From the course: Angular: API Communication and Authentication

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating a new route for adding a new contact

Creating a new route for adding a new contact - Angular Tutorial

From the course: Angular: API Communication and Authentication

Start my 1-month free trial

Creating a new route for adding a new contact

- [Narrator] Now that we are able to retrieve our contacts, our next goal is the ability to add a new contact. We will be adding a new route that will present the user with the form. Going to pop over to my terminal here and use the NU CLI to generate a new component. And we can see here, we refresh our files here. The new component is generated. Let's head over to our app routing module and import this component. We will be creating a new route. The path for this will be new, and the component to render at this route will be the AddContactComponent. We also want to create a button that the user can click on to navigate to this component. In our menu component, we will be adding this button using the routerLink directive, which will let us navigate to the route we just created. Here I'm using the routerLink directive. And I'm going to give it some basic styles from the the Semantic UI framework. Let's add an icon to represent adding a new contact. And the text for this button would be…

Contents