Angular MCQs – Introduction to Angular

21.) Which Angular package is required to handle HTTP requests?

A) @angular/router
B) @angular/forms
C) @angular/http
D) @angular/common/http

Answer: Option D

Explanation: The @angular/common/http package is used to send and receive HTTP requests in Angular applications.

22.) What is Two-Way Data Binding in Angular?

A) Only the model updates the view
B) Only the view updates the model
C) The model and view update each other
D) Data flows only from parent to child component

Answer: Option C

Explanation: Two-way data binding ensures changes in the model are reflected in the view and vice versa, using [(ngModel)].

23.) What is the purpose of the tsconfig.json file in an Angular project?

A) Configures TypeScript compilation settings
B) Manages routing configurations
C) Defines Angular component styles
D) Stores Angular service configurations

Answer: Option A

Explanation: The tsconfig.json file defines TypeScript compiler options for an Angular project.

24.) What is the purpose of the angular.json file?

A) Defines Angular modules
B) Stores configuration settings for an Angular project
C) Manages API calls
D) Handles user authentication

Answer: Option B

Explanation: The angular.json file contains Angular project settings, including build and test configurations.

25.) What is the primary function of the package.json file in an Angular project?

A) Defines project styles
B) Contains HTML templates
C) Configures Angular modules
D) Lists dependencies and scripts

Answer: Option D

Explanation: The package.json file contains project dependencies, scripts, and metadata for an Angular application.

26.) Which major change occurred with the release of Angular 2 in 2016?

A) It introduced a completely new architecture based on TypeScript
B) It replaced JavaScript with Python
C) It removed the need for HTML and CSS
D) It became a backend framework

Answer: Option A

Explanation: Angular 2 was a complete rewrite of AngularJS, introducing TypeScript and a component-based architecture.

Leave a Reply

Your email address will not be published. Required fields are marked *