Angular Quiz
Test your Angular knowledge. — 8 questions
About the Angular Quiz
Test your Angular knowledge. This quiz has 8 multiple-choice questions. Each question has one correct answer, and you see an explanation straight after you answer, so you learn from every question — including the ones you get wrong. There is no time limit and nothing to sign up for; your answers are not stored.
The questions follow the material in the Angular Fundamentals guide and the Angular cheatsheet. Read them first if you want to prepare, or take the quiz cold to find the gaps in what you know.
Questions in this quiz
Preview the questions below. Each answer and its explanation are hidden until you choose to reveal them, so you can still take the quiz above without spoilers.
1. Which decorator marks a TypeScript class as an Angular component?
Show answer
Answer: C. @Component
@Component configures the selector, template, and styles. @Injectable is for services, @NgModule for modules.
2. What is the syntax for two-way data binding in Angular?
Show answer
Answer: C. [(ngModel)]
[(ngModel)] combines [] property binding and () event binding — nicknamed "banana in a box". Requires FormsModule.
3. Which directive conditionally adds or removes an element from the DOM?
Show answer
Answer: B. *ngIf
*ngIf removes the element entirely when false. [ngClass] only toggles CSS classes without removing the element.
4. What is the purpose of a Service in Angular?
Show answer
Answer: C. Share reusable logic and data between components
Services hold business logic and shared data. They are injected via DI rather than instantiated directly.
5. How is a service injected into a component?
Show answer
Answer: C. Through the constructor via Dependency Injection
Angular reads constructor parameter types and provides the registered singleton automatically.
6. What does *ngFor do?
Show answer
Answer: B. Iterates a collection, rendering a template for each item
*ngFor="let item of items" renders the host element once per item, creating a local template variable.
7. What is an Angular pipe used for?
Show answer
Answer: C. Transforming displayed values in templates
Pipes transform values inline: {{ date | date:"short" }}, {{ amount | currency }}. Custom pipes use @Pipe.
8. What does the @Input() decorator do?
Show answer
Answer: B. Allows the property to be set by a parent component
@Input() exposes a property so parent components can pass data down: <child [title]="myTitle">.
How to use this quiz
- Answer every question before reading the explanations below — retrieving an answer from memory is what makes it stick.
- Note the questions you missed and revisit the matching section of the guide or cheatsheet.
- Retake the quiz a day or two later. Spaced repetition is one of the most reliable ways to remember technical details.