Angular

Angular CLI

ng new, ng generate, ng serve, ng build, ng test, configuration, workspaces, schematics, builders

18 interview questionsยท
Junior
1

Which command creates a new Angular project?

Answer

The ng new command creates a new Angular project with all necessary configuration files (angular.json, tsconfig.json, package.json), automatically installs npm dependencies and initializes a Git repository. This command is the standard starting point for any Angular project and sets up the structure recommended by the Angular team. It also offers interactive options to choose routing, CSS preprocessor and TypeScript strict mode.

2

Which command starts the Angular development server?

Answer

The ng serve command starts the Angular development server with automatic reload (hot reload). It compiles the application in development mode and makes it accessible on localhost:4200 by default. The server watches for TypeScript, HTML and CSS file changes, then automatically recompiles and refreshes the browser for an efficient development workflow. This command uses webpack-dev-server behind the scenes to optimize compilation performance.

3

Which file contains the main Angular project configuration?

Answer

The angular.json file contains all Angular project configuration, including build options, asset paths, environment configurations and builder settings. This central file allows customizing CLI behavior, defining configurations for development and production, configuring global style and script paths, and managing multiple projects in a multi-project workspace. It is the most important file for Angular CLI configuration.

4

Which command compiles the Angular application for production?

5

Which command runs unit tests in an Angular project?

+15 interview questions

Master Angular for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free