
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































Angular Web Development Exam 2026: Professional Certification Practice Test — Components, Directives, Services, Dependency Injection, Routing, Forms, RxJS & State Management — 190 Multiple- Choice Questions with Answers & Detailed Rationales Section 1: Angular Fundamentals and Architecture (Questions 1-25) Question 1 What is the primary architectural pattern that Angular follows for building web applications? A. Model-View-Controller (MVC) B. Component-Based Architecture C. Model-View-ViewModel (MVVM) D. Layered Architecture Correct Answer : B Explanation: Angular primarily uses component-based architecture where applications are built as hierarchical trees of reusable, self-contained components with encapsulated logic and templates. Question 2 Which Angular decorator is used to define a class as an Angular module?
A. @Component B. @Injectable C. @NgModule D. @Directive Correct Answer : C Explanation: @NgModule decorator marks a class as an Angular module, providing metadata about declarations, imports, exports, and providers for the application. Question 3 What is the primary purpose of the Angular CLI command ng new? A. Creates a new Angular component B. Generates a new Angular service C. Creates a new Angular workspace and application D. Initializes a new Git repository Correct Answer : C
C. app.module.ts D. angular.json Correct Answer : B Explanation: The main.ts file serves as the entry point where Angular bootstraps the root module, making it the starting point for application execution. Question 6 What is the purpose of the angular.json configuration file? A. Defines TypeScript compiler options B. Stores package dependencies C. Configures workspace-wide and project-specific build settings D. Manages environment variables Correct Answer : C Explanation: The angular.json file contains workspace configuration including build options, project settings, architect targets, and CLI defaults for all projects. Question 7
Which Angular building block is responsible for encapsulating application logic and user interface? A. Module B. Service C. Component D. Pipe Correct Answer : C Explanation: Components are the fundamental building blocks that combine a TypeScript class with an HTML template and CSS styles to create reusable UI elements. Question 8 What decorator must be applied to a class to make it an Angular component? A. @NgModule B. @Component C. @Injectable D. @Directive
B. Specifies the CSS styles for the component C. Defines the template URL D. Configures dependency injection Correct Answer : A Explanation: The selector property defines the CSS selector that identifies where the component should be rendered in the parent template as a custom HTML element. Question 11 In Angular, what is a module primarily used for? A. Defining routes for navigation B. Creating reusable UI components C. Organizing and grouping related code into cohesive blocks D. Handling HTTP requests Correct Answer : C Explanation: Modules organize related components, directives, pipes, and services into cohesive blocks, providing context for compilation and dependency injection.
Question 12 Which property in @NgModule declares components, directives, and pipes that belong to the module? A. imports B. exports C. declarations D. providers Correct Answer : C Explanation: The declarations array in @NgModule metadata specifies which components, directives, and pipes belong to and are usable within that specific module. Question 13 What is the purpose of the imports array in @NgModule? A. Lists services available for dependency injection B. Specifies other modules whose exported declarations are needed C. Defines components for the module
A. Provides routing configuration only B. Serves as the root module that bootstraps the application C. Handles all HTTP communications D. Manages global state Correct Answer : B Explanation: AppModule is the root module conventionally used to bootstrap the application, declaring the root component and importing essential feature modules. Question 16 Which command is used to serve an Angular application locally during development? A. ng build B. ng serve C. ng run D. ng start Correct Answer : B
Explanation: The ng serve command builds the application and starts a development server with live reload, typically accessible at localhost:4200. Question 17 What does the ng build command accomplish? A. Starts a development server B. Runs unit tests C. Compiles the application into output files for deployment D. Generates new components Correct Answer : C Explanation: The ng build command compiles TypeScript, bundles assets, and produces optimized output files in the dist folder for deployment to web servers. Question 18 In Angular, what is the purpose of the bootstrap array in @NgModule? A. Lists all components in the module B. Identifies the root component(s) to launch the application
What is the significance of the index.html file in an Angular application? A. Contains the root component template B. Serves as the main HTML page that hosts the application C. Defines module configuration D. Stores environment variables Correct Answer : B Explanation: The index.html file is the main HTML page served to browsers, containing the element where Angular renders the application. Question 21 Which TypeScript configuration file in Angular projects controls compiler options? A. angular.json B. package.json C. tsconfig.json D. tslint.json Correct Answer : C
Explanation: The tsconfig.json file specifies TypeScript compiler options such as target version, module system, strictness settings, and path mappings. Question 22 What is the purpose of the package.json file in an Angular project? A. Configures Angular CLI settings B. Defines project dependencies and npm scripts C. Specifies TypeScript compilation rules D. Contains component metadata Correct Answer : B Explanation: The package.json file lists npm dependencies, devDependencies, and scripts for building, testing, and running the Angular application. Question 23 In Angular, what does the term "workspace" refer to? A. A single component's scope B. A collection of Angular projects managed together
What is the role of the polyfills.ts file in an Angular project? A. Defines application routes B. Provides compatibility for older browsers C. Configures HTTP interceptors D. Manages state management Correct Answer : B Explanation: The polyfills.ts file imports scripts that provide functionality for browsers lacking native support for certain features, ensuring cross-browser compatibility. Section 2: Components and Templates (Questions 26-55) Question 26 What is the purpose of Angular's template syntax? A. To define CSS styles B. To extend HTML with Angular-specific features for dynamic content C. To configure TypeScript compilation D. To manage dependencies
Correct Answer : B Explanation: Angular's template syntax extends HTML with directives, bindings, and expressions, enabling dynamic content rendering and user interaction handling. Question 27 Which binding type is used to display component data in the template? A. Event binding B. Property binding C. Interpolation D. Two-way binding Correct Answer : C Explanation: Interpolation uses double curly braces {{ }} to display component property values as text within the template's HTML content. Question 28 What syntax is used for property binding in Angular templates? A. {{ property }}
Question 30 What is two-way data binding in Angular, and what syntax represents it? A. [property] - One-way from component to view B. (event) - One-way from view to component C. [(ngModel)] - Combined property and event binding D. {{ value }} - Interpolation only Correct Answer : C Explanation: Two-way binding with [(ngModel)] combines property and event binding, keeping component data and view synchronized in both directions simultaneously. Question 31 Which directive is required to use [(ngModel)] for two-way binding on form elements? A. NgIf B. NgFor C. FormsModule
D. CommonModule Correct Answer : C Explanation: The FormsModule must be imported to use ngModel directive, which provides two-way data binding for form controls in Angular templates. Question 32 What is the purpose of the *ngIf structural directive? A. Repeats elements for each item in a collection B. Conditionally adds or removes elements from the DOM C. Styles elements based on conditions D. Binds data to element properties Correct Answer : B Explanation: The *ngIf directive conditionally includes or excludes elements from the DOM based on the truthiness of the provided expression. Question 33 Which structural directive is used to iterate over a collection in Angular templates?