MyInternships.in

Angular Basics

Angular Installation and Setup

Angular projects are created with the Angular CLI, a command-line tool that scaffolds the project, runs a dev server, generates components and services, and produces the production build.


What is Installation and Setup in Angular?

Angular projects are created with the Angular CLI, a command-line tool that scaffolds the project, runs a dev server, generates components and services, and produces the production build.

Why Installation and Setup matters

The CLI is not optional in practice. It wires up TypeScript, the build pipeline, testing and the file conventions the whole ecosystem expects, and every Angular tutorial and job assumes you use it.

Installation and Setup example

Create and run a project
Terminal
npm install -g @angular/cli
ng new my-app          # asks about routing and stylesheet format
cd my-app
ng serve --open        # dev server on http://localhost:4200

The commands you will use every day

Terminal
ng generate component job-card    # or: ng g c job-card
ng generate service api           # ng g s api
ng build                          # production bundle into dist/
ng test                           # unit tests
ng version                        # check Angular and Node versions

Key points to remember

  • Node.js must satisfy the version range for your Angular release — ng version reports both.
  • ng generate creates the class, template, styles and spec file together and registers everything.
  • ng serve rebuilds and reloads on save; it is never used to serve production.

Common mistakes with Installation and Setup

  • A globally installed CLI older than the project, which produces confusing errors — the local npx ng always matches.
  • Running ng new inside an existing project folder.
  • Deploying the dev server instead of the built dist folder.

Angular Installation and Setup— Interview Questions & FAQs

Do I need to install the Angular CLI globally?+

It is convenient but not required. npx @angular/cli new my-app works without a global install, and inside a project npm run ng always uses the matching local version.

Related Angular Topics

Keep learning with these closely related lessons.

Ready to use your Angular skills?

Find verified Angular internships and fresher developer jobs across India.

Browse Angular Internships