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.
Step 3. After installing Angular CLI, now create a new project. First of all, provide the project directory path and hit enter.
Step 4. Then give this command and hit enter, the fourth sample is my application name, you can give any name.
Step 5. Wait until all files are added.
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.
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.
Step 8
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.