Loading...
Loading...
Compare original and translation side by side
import { Component, signal, computed } from "@angular/core";
@Component({
selector: "app-counter",
standalone: true,
template: `
<p>Count: {{ count() }}</p>
<p>Double: {{ double() }}</p>
<button (click)="increment()">Increment</button>
`,
})
export class CounterComponent {
count = signal(0);
double = computed(() => this.count() * 2);
increment() {
this.count.update((c) => c + 1);
}
}import { Component, signal, computed } from "@angular/core";
@Component({
selector: "app-counter",
standalone: true,
template: `
<p>Count: {{ count() }}</p>
<p>Double: {{ double() }}</p>
<button (click)="increment()">Increment</button>
`,
})
export class CounterComponent {
count = signal(0);
double = computed(() => this.count() * 2);
increment() {
this.count.update((c) => c + 1);
}
}Zone.jsZone.jsNgModuleNgModule@defer@defer@defer (on viewport) {
<heavy-chart />
} @placeholder {
<p>Loading...</p>
}@defer (on viewport) {
<heavy-chart />
} @placeholder {
<p>Loading...</p>
}signal()BehaviorSubjectinject()inject(Service)provideExperimentalZonelessChangeDetection()NgModuleCommonModule@if@for*ngIf*ngForsignal()BehaviorSubjectinject()inject(Service)provideExperimentalZonelessChangeDetection()NgModuleCommonModule@if@for*ngIf*ngFor