Angular CLI (Command Line Interface) is your forge - a tool for creating, building, and managing Angular projects.
Before installation you need:
Check versions:
1node --version
2# Should show v18.19.0 or newer
3
4npm --version
5# Should show 9.x or newerOpen the terminal and type:
1npm install -g @angular/cliThe `-g` flag means global installation - the CLI will be available from anywhere in the system.
1ng versionYou should see information about the installed Angular CLI version and supported Node.js and TypeScript versions.
1# Create a new project
2ng new my-dojo
3
4# CLI will ask:
5# ? Which stylesheet format would you like to use? (CSS, SCSS, Sass, Less)
6# ? Do you want to enable Server-Side Rendering (SSR)? (y/N)After creating the project you will see:
1my-dojo/
2βββ src/
3β βββ app/
4β β βββ app.component.ts # Main component
5β β βββ app.component.html # Template
6β β βββ app.component.scss # Styles
7β β βββ app.config.ts # Configuration
8β β βββ app.routes.ts # Routing
9β βββ index.html # Main HTML file
10β βββ main.ts # Entry point
11β βββ styles.scss # Global styles
12βββ angular.json # Project configuration
13βββ package.json # npm dependencies
14βββ tsconfig.json # TypeScript configuration1cd my-dojo
2ng serveThe application will be available at: http://localhost:4200
1ng serve --open # Automatically opens the browser
2ng serve --port 3000 # Changes the port
3ng serve --watch # Automatic refresh (enabled by default)