Getting Started With Angular 2 Using Angular CLI

Why Angular CLI?

Angular CLI is a command line interface tool that can create a project, add files, and perform various ongoing development tasks such as testing, bundling, and deployment.

Before moving ahead, if you want to read my previous Angular 2 samples without Angular CLI, here is the list.

Getting Started

Follow these steps

Step 1. First of all, make sure your machine has Node.js and npm installed. You can install it from here.

https://nodejs.org/en/download/

Step 2. Now install Angular CLI using a command prompt. Install Angular CLI globally.

Install angular CLI

Step 3. After installing Angular CLI, now create a new project. First of all, provide the project directory path and hit enter.

After installing angular

Step 4. Then give this command and hit enter, the fourth sample is my application name, you can give any name.

Command and hit enter

Step 5. Wait until all files are added.

Wait until all files

Step 6. If you check the directory then all files are added like this, which means the application is created and all required files are added.

Created and all required files

Step 7. Now run the project, go to the project directory using the command prompt hit this command, and wait until the command is completed.

Hit this command and wait until

Step 8

welcome to app

As you can see, the application runs in the browser without writing any lines of code or adding built-in files. Now you can add models, components, HTML, and style sheets.

Conclusion

In this article, I explained the very basic steps of how to get started with Angular CLI. If you have any questions or comments, drop me a line in the comments section.


Similar Articles