Practice these MCQs to strengthen your Angular knowledge and prepare confidently for job interviews or certification exams.
Whether you’re aiming to become a front-end specialist, a full-stack developer, or simply sharpen your skills in component-driven architecture and reactive programming — you’re in the right place.
70+ Angular MCQs covering everything from components, services, directives, routing, forms, observables, and advanced concepts — complete with answers to help you test and solidify your understanding, no guesswork involved.
Section 1: Angular Basics – 10 MCQs
- Which command is used to create a new Angular project?
A. ng generate app
B. ng new
C. ng create
D. npm start
✅ Answer: B - What is the purpose of Angular CLI?
A. To test applications
B. To style components
C. To scaffold and manage Angular projects
D. To host the app
✅ Answer: C - Which architecture pattern does Angular follow?
A. MVC
B. MVVM
C. Component-based
D. MVP
✅ Answer: C - Which file is the entry point of an Angular app?
A. index.html
B. main.ts
C. app.module.ts
D. app.component.ts
✅ Answer: B - Which command is used to serve an Angular app locally?
A. ng build
B. ng init
C. ng serve
D. ng run
✅ Answer: C - What decorator is used to define a component in Angular?
A. @Injectable
B. @Component
C. @Directive
D. @Module
✅ Answer: B - Which of the following is not a valid Angular data binding type?
A. Event binding
B. Property binding
C. Two-way binding
D. String binding
✅ Answer: D - How do you bind an input value to a variable using two-way data binding?
A. [(ngBind)]
B. [value]=”var”
C. [(ngModel)]=”var”
D. bind:value=”var”
✅ Answer: C - Which module is needed for using two-way binding with ngModel?
A. ReactiveFormsModule
B. HttpClientModule
C. FormsModule
D. BrowserModule
✅ Answer: C - What will this display?
<p>{{ 2 + 3 }}</p>
A. 2 + 3
B. Five
C. 5
D. Error
✅ Answer: C
Master Angular in Gurgaon with Gyansetu – Learn. Build. Excel.
Section 2: Components & Templates – 10 MCQs
- What file extension is used for Angular components?
A. .js
B. .ts
C. .component.ts
D. .module.ts
✅ Answer: C - What is the default selector in a component class?
A. templateUrl
B. selector
C. styleUrls
D. providers
✅ Answer: B - Which part defines the HTML template in a component?
A. templateFile
B. templateRef
C. templateUrl
D. viewUrl
✅ Answer: C - How do you pass data from parent to child component?
A. @Output()
B. @Child()
C. @Input()
D. @Provide()
✅ Answer: C - Which lifecycle hook runs after the component’s first display?
A. ngInit()
B. ngRender()
C. ngAfterViewInit()
D. ngStart()
✅ Answer: C - Which of the following is NOT a component lifecycle hook?
A. ngOnInit
B. ngOnDestroy
C. ngAfterInit
D. ngAfterContentInit
✅ Answer: C - What will be logged here?
ngOnInit() {
console.log(“Init called”);
}
A. On each reload
B. Before component mounts
C. After constructor, once
D. On every change
✅ Answer: C
- Which decorator makes a class injectable into components?
A. @Component
B. @Injectable
C. @Provider
D. @Service
✅ Answer: B - Which binding passes a variable from HTML to component?
A. [(…)]
B. [property]
C. (event)
D. {{ variable }}
✅ Answer: B - What does @ViewChild() do?
A. Binds HTML content
B. Selects parent component
C. Gets reference to a child element
D. Binds event
✅ Answer: C
Section 3: Directives & Pipes – 10 MCQs
- Which directive displays an element based on a condition?
A. *ngShow
B. *ngVisible
C. *ngIf
D. *ngHide
✅ Answer: C - What is the output?
<p *ngIf=”false”>Hello</p>
A. Hello
B. false
C. Nothing
D. Syntax error
✅ Answer: C
- Which directive is used for looping in Angular?
A. *ngEach
B. *ngFor
C. *ngLoop
D. *ngRepeat
✅ Answer: B - Syntax of ngFor is:
A. *ngFor=”let item of items”
B. *ngFor=”item in items”
C. *ngFor=”let items in item”
D. ngFor=”items”
✅ Answer: A - What is a pipe used for?
A. Looping
B. Conditional rendering
C. Data transformation
D. Routing
✅ Answer: C - What is the output of this pipe?
{{ ‘angular’ | uppercase }}
A. angular
B. Angular
C. ANGULAR
D. Error
✅ Answer: C
Become an Angular Pro – Enroll in Gyansetu’s Industry-Focused Training!
- Which pipe formats a date?
A. datePipe
B. date
C. formatDate
D. datetime
✅ Answer: B - Which is a built-in Angular directive?
A. ngBind
B. ngValue
C. ngModel
D. ngContent
✅ Answer: C - Custom pipes must implement which interface?
A. OnInit
B. PipeCreator
C. PipeTransform
D. CustomPipe
✅ Answer: C - A structural directive changes:
A. Element position
B. DOM layout
C. CSS styling
D. None
✅ Answer: B
Section 4: Routing & Navigation – 10 MCQs
- Which module is required for Angular routing?
A. RouterModule
B. AppRouting
C. RoutingModule
D. NavigationModule
✅ Answer: A - What is the correct syntax for a route path?
{ path: ‘home’, component: HomeComponent }
A. True
B. False
✅ Answer: A
- How do you navigate programmatically in Angular?
A. Router.navigate(‘path’)
B. navigateTo(‘path’)
C. this.router.navigate([‘path’])
D. go(‘path’)
✅ Answer: C - What does <router-outlet> do?
A. Defines routing logic
B. Loads the route’s component view
C. Stores routing state
D. Triggers event routing
✅ Answer: B - What is the purpose of a wildcard route (**)?
A. Redirect unknown routes
B. Define default component
C. Catch homepage requests
D. Replace route names
✅ Answer: A - What is route guard in Angular?
A. Directive for routes
B. Prevent unauthorized access
C. Used for animations
D. Optimize routing speed
✅ Answer: B - Which interface is used to create a route guard?
A. RouteCheck
B. RouterGuard
C. CanActivate
D. GuardRoute
✅ Answer: C - How do you add a route redirect?
{ path: ”, redirectTo: ‘/home’, pathMatch: ‘full’ }
A. True
B. False
✅ Answer: A
- Which module provides the RouterLink directive?
A. AppModule
B. BrowserModule
C. RouterModule
D. FormsModule
✅ Answer: C - What is lazy loading in Angular?
A. Loads components after delay
B. Loads modules on demand
C. Reduces initial bundle size
D. Both B and C
✅ Answer: D
From Basics to Advanced – Angular Training That Gets You Hired
Section 5: Forms – 10 MCQs
- What are the two types of forms in Angular?
A. HTML and JavaScript forms
B. Template-driven and reactive forms
C. Reactive and hybrid forms
D. Input and submit forms
✅ Answer: B - Which module is needed for reactive forms?
A. ReactiveFormsModule
B. FormsModule
C. HttpClientModule
D. BrowserModule
✅ Answer: A - What is FormControl used for?
A. Control layout
B. Group components
C. Handle form inputs
D. None
✅ Answer: C - Which method resets a form in reactive forms?
A. resetForm()
B. clearForm()
C. form.reset()
D. form.clear()
✅ Answer: C - Which directive is used for two-way binding in forms?
A. ngModel
B. modelForm
C. ngBind
D. formBind
✅ Answer: A - What is the output of this template-driven form input?
<input [(ngModel)]=”name” name=”username”>
A. One-way binding
B. Two-way binding
C. No binding
D. Error
✅ Answer: B
- In Reactive forms, what is FormGroup used for?
A. Styling
B. Group form controls
C. Route forms
D. Resetting forms
✅ Answer: B - What’s the correct way to initialize a FormControl?
new FormControl(‘Initial Value’)
A. True
B. False
✅ Answer: A
- Which is used to validate email format?
A. Validators.required
B. Validators.email
C. Validators.minLength
D. Validators.pattern
✅ Answer: B - Which object returns the state of the form?
A. status
B. formState
C. valid
D. form.valid
✅ Answer: D
Section 6: Services, Dependency Injection, Observables – 10 MCQs
- What does a service in Angular provide?
A. Business logic
B. UI logic
C. CSS styling
D. Routes
✅ Answer: A - How do you make a class a service?
A. Add @Injectable() decorator
B. Add @Service()
C. Import it to AppComponent
D. Register in CLI
✅ Answer: A - What is Dependency Injection (DI)?
A. HTML injection
B. Injecting scripts
C. Providing service to component
D. Database connection
✅ Answer: C - Which RxJS operator is used to handle asynchronous data?
A. of()
B. async()
C. subscribe()
D. map()
✅ Answer: C - What is the role of subscribe() in observables?
A. Create service
B. Handle data response
C. Display templates
D. Bind HTML
✅ Answer: B - Which RxJS operator transforms values?
A. filter()
B. pipe()
C. switchMap()
D. map()
✅ Answer: D - What will this observable return?
of(1, 2, 3).subscribe(console.log);
A. 123
B. [1, 2, 3]
C. Logs 1, then 2, then 3
D. Error
✅ Answer: C
- How to inject a service into a component?
A. Via HTML binding
B. Via constructor
C. Via selector
D. Cannot inject
✅ Answer: B - Which keyword is used to define a provider in Angular module?
A. services
B. inject
C. providers
D. exports
✅ Answer: C - Which statement is true about observables?
A. They’re synchronous
B. They emit multiple values over time
C. They return promises
D. Not part of Angular
✅ Answer: B
Section 7: Advanced Angular – 10 MCQs
- What is Change Detection in Angular?
A. Detects HTML changes
B. Watches for file changes
C. Updates the view when data changes
D. Event tracking
✅ Answer: C - Which strategy optimizes change detection?
A. OnPush
B. Default
C. Manual
D. Auto
✅ Answer: A - What is the purpose of Angular Universal?
A. Adds routing
B. Enables SSR (Server Side Rendering)
C. Removes templates
D. Enables animations
✅ Answer: B - What is a feature module?
A. Module for root routes
B. External service
C. Module with isolated functionality
D. Bootstrap file
✅ Answer: C - What is Ahead-of-Time (AOT) compilation?
A. Compiles in runtime
B. Compiles templates before app loads
C. Compiles during runtime
D. Removes JS files
✅ Answer: B - What is a singleton service in Angular?
A. Service created once and reused
B. Service created per component
C. External API
D. Repeated service
✅ Answer: A - How do you share data between unrelated components?
A. Input binding
B. Output binding
C. Services
D. Query binding
✅ Answer: C - What does ng-content do?
A. Binds styles
B. Displays default content
C. Projects external content into component
D. Renders dynamic CSS
✅ Answer: C - How do you lazy load a module?
A. Using loadModule()
B. Using RouterModule.forRoot
C. With dynamic import in routes
D. Using AppModule
✅ Answer: C - Which CLI command builds a production app?
A. ng serve
B. ng prod
C. ng build –prod
D. ng make
✅ Answer: C
Mastering these Angular MCQs is a valuable step toward building a strong foundation in component-based architecture, TypeScript, reactive forms, routing, and modern front-end development practices.
If you’re ready to elevate your career with hands-on projects and expert-led instruction, join our Angular course in Gurgaon at Gyansetu and become industry-ready for front-end and full-stack development roles.