The Angular CLI is a command line interface for Angular which you can use to create a basic working application, generate components, routes, services and pipes with a simple command.
To install Angular CLI in your computer you can run
npm install -g @angular/cli. Once installed, you can create a new app by running
ng new my-app.
The structure of the new project should look something like this:
├── README.md ├── angular-cli.json ├── e2e … ├── karma.conf.js ├── node_modules … ├── package.json ├── protractor.conf.js ├── src … └── tslint.json
Using your new app
To start your Angular project, run
ng serve from inside the project folder. This will run a local server at http://localhost:4200 and it will also watch for changes in your project and refresh the page automatically.
If you want to create a new component in Angular, you can use the
ng generate command. For example
ng generate component path/component-name. You can use the same command to generate routes, pipes, services and directives aswell. A full list of commands can be found here.