0
0
Angularframework~20 mins

What is Angular - Practice Questions & Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Angular Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary purpose of Angular?

Angular is a popular framework. What is its main use?

ATo style web pages using CSS rules
BTo build dynamic web applications with reusable components
CTo manage databases and server-side logic
DTo write backend APIs in Node.js
Attempts:
2 left
💡 Hint

Think about what Angular helps you create on the web.

component_behavior
intermediate
2:00remaining
What happens when you update a signal in Angular?

In Angular 17+, signals are used to track state. What occurs when you update a signal's value?

AThe signal value updates but components must be manually notified
BNothing changes until the page is refreshed manually
CAll components using that signal automatically update their view
DThe application crashes due to state inconsistency
Attempts:
2 left
💡 Hint

Signals help Angular know when to update the UI automatically.

lifecycle
advanced
2:00remaining
What is the role of the inject() function in Angular 17+?

Angular 17 introduced the inject() function. What does it do?

AIt is used to inject CSS styles dynamically into components
BIt replaces the need for services by directly injecting HTML elements
CIt automatically injects global variables into the component scope
DIt allows retrieving dependencies inside standalone components or functions without constructor injection
Attempts:
2 left
💡 Hint

Think about how Angular manages dependencies without classes.

📝 Syntax
advanced
2:00remaining
Which Angular template syntax correctly uses the new control flow directive to conditionally render content?

Angular 17+ introduced new control flow directives. Which option correctly shows conditional rendering using @if?

Angular
<section *ngIf="isVisible">Visible content</section>
A<section @if(isVisible)>Visible content</section>
B<section *ngIf="isVisible">Visible content</section>
C@if (isVisible) { <section>Visible content</section> }
D<section *if="isVisible">Visible content</section>
Attempts:
2 left
💡 Hint

Angular 17+ uses @if instead of *ngIf in templates.

🔧 Debug
expert
3:00remaining
Why does this Angular standalone component fail to render?

Consider this Angular standalone component code snippet:

import { Component, signal } from '@angular/core';

@Component({
  selector: 'app-counter',
  standalone: true,
  template: ``
})
export class CounterComponent {
  count = signal(0);

  increment() {
    this.count += 1;
  }
}

Why does clicking the button not update the displayed count?

ABecause signals are functions; incrementing with '+=' does not update the signal value correctly
BBecause the signal should be declared as a regular number, not using signal()
CBecause the template syntax for event binding is incorrect
DBecause the component is missing the imports array in the decorator
Attempts:
2 left
💡 Hint

Remember how to update signals properly in Angular.