Angular Sample Application – Part 2

Hello Geek, Good Morning. I hope you have a great weekend going. I wake up early today to write something about Angular.

I am going to post about how to create a component in Angular. That will be a good starter in your Angular learning. 🙂

I hope you have read the Part – 1 of this tutorial, if not then do not worry, read it here Angular Sample Application – Part 1

So, let’s start.

To create a component in Angular you need to use the following command.

ng generate component component-name-with-path

You can also use the following short command.

ng g c  component-name-with-path

We will create the following three components and learn

  1. header
  2. home
  3. footer

So execute the following three commands.

  1. For header: ng g c components/header
  2. For home: ng g c components/home
  3. For footer: ng g c components/footer

This command will create a component in the components folder.

Now, we will learn how to do routing in Angular.

Click here to read – Angular Sample Application – Part 3

Author: Jaydip Panchal

Hello, This is jaydip panchal here, who do code, dream code, eat code, drink code, walk code. #CodeWithJaydip #CodeWithGeek

Leave a Reply

Your email address will not be published. Required fields are marked *