Subscribe Us

banner image

Disclaimer

banner image

Angular CLI Components

 Angular CLI Components 




The component is the main block in the Angular CLI Application.  Each Component consists of four files::


  1. HTML File   (What you want to show on Your Page)
  2. CSS File       (Style Applied to your content)
  3. TypeScript    (Main Class of Component where you define the behavior)
  4. CSS Selector (Define how the component is used )

In this article, we will discuss how to create and configure the Angular CLI Component. Before this, you have done some prerequisite 

  1. Install Angular CLI
  2. Create a New Project
    • ng new <Project-name>              // Type this to CMD to create a new project 
Nice now you have Angular CLI and a brand new Angular Project. So now we will create a component in our project. There two ways to create a component.

  1. Creating Component using ANGULAR CLI
  2. Creating Component Manully 
In this article, We will learn and create a component by using Angular CLI

  1. First, navigate to your project directory using Terminal
  2. Run the Command
 ng generate component <component-name>
ng means Angular and <component-name>  is the name of your component.

So congratulations you create a new component in your first project.



If you have any questions or error please let me know in the below comment session I will be happy to help you Thanks!  


Angular CLI Components Angular CLI Components Reviewed by Gaming Zone on January 16, 2021 Rating: 5

No comments:

If You have any Questions and Suggestions Please let me know. Thank you!

PS5

6/PS5/mini-slide
Powered by Blogger.