Angular is a popular framework. What is its main use?
Think about what Angular helps you create on the web.
Angular is designed to build dynamic, interactive web apps using components that can be reused.
In Angular 17+, signals are used to track state. What occurs when you update a signal's value?
Signals help Angular know when to update the UI automatically.
Signals notify Angular to re-render components that depend on them when their value changes.
inject() function in Angular 17+?Angular 17 introduced the inject() function. What does it do?
Think about how Angular manages dependencies without classes.
The inject() function lets you get dependencies in standalone components or functions without using constructors.
Angular 17+ introduced new control flow directives. Which option correctly shows conditional rendering using @if?
<section *ngIf="isVisible">Visible content</section>Angular 17+ uses @if instead of *ngIf in templates.
The new Angular control flow directive uses @if for conditional rendering, replacing *ngIf.
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?
Remember how to update signals properly in Angular.
Signals are functions. To update their value, you must call this.count.set(this.count() + 1) instead of using '+='.