1. 6
    Create a New Task Page with Angular CLI ng generate
    1m 20s

Create a New Task Page with Angular CLI ng generate

Jorge Vergara
InstructorJorge Vergara
Share this video with your friends

Social Share Links

Send Tweet
Published 2 years ago
Updated a year ago

We need to add a new tasks page so we'll add a button on the home page and link to this new page with routerLink.

Then we'll use the Angular CLI to create a new page with ng generate. Finally we'll add the page route to our routing.module.

Instructor: [0:00] To add new tasks to our database, first, we are going to create a button here to navigate to the create task page. If we try to navigate right now to that page, we get an error because that route doesn't exist.

[0:26] We are going to go ahead and terminate our server, and we are going to create a new component for our task detail page. Now, we can see that it added that page to our module and we are going to go to our task routing module.

[0:48] We are also going to add a route with that page here. Anything that goes to tasks, it's going to go to the tasks page and anything that goes to task/ and dynamic task ID, it's going to go to our new task page component.

[1:07] Now, we can fire up our server again. If I click the plus button, I can see task work. It is taking me to the task component.

egghead
egghead
~ 4 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today