Loading

Quipoin Menu

Learn • Practice • Grow

angular / Installation and Setup
interview

Q1. What are the prerequisites for installing Angular?
To install Angular, you need Node.js and npm (Node Package Manager) installed on your system. Angular requires Node.js version 18.x or later. You also need a code editor (like VS Code) and basic knowledge of the command line. The Angular CLI is installed globally using npm.

Q2. How do you install Angular CLI globally?
Open a terminal/command prompt and run:
npm install -g @angular/cli
This installs the Angular CLI globally, making the ''ng'' command available from any directory. To verify installation, run:
ng version

Q3. How do you create a new Angular project?
After installing Angular CLI, create a new project using:
ng new my-angular-app
You''ll be prompted to choose features like routing and stylesheet format (CSS, SCSS, etc.). The CLI creates a new folder with the project structure and installs dependencies. To serve the application, navigate into the folder and run
ng serve

Q4. What is the purpose of the angular.json file?
The angular.json file is the workspace configuration file for Angular CLI. It defines project-specific settings like build configurations, output paths, asset paths, style preprocessor options, and testing settings. It allows you to configure how the CLI builds, serves, and tests your application. You can define multiple project configurations in a single workspace.

Q5. How do you run an Angular application in development mode?
Use the command
ng serve
This starts a development server, typically on http://localhost:4200. It watches for file changes and automatically reloads the application. You can specify options like --port, --host, or --open. The development build includes source maps and does not optimize for production.