import {
ChangeDetectionStrategy,
Component,
effect,
model,
} from '@angular/core';
import { FormsModule } from '@angular/forms';
@Component({
standalone: true,
imports: [FormsModule],
selector: 'app-root',
template: `
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent {
drive = model(false);
ram = model(false);
gpu = model(false);
constructor() {
/*
Explain for your junior team mate why this bug occurs ...
*/
effect(() => {
if (this.drive() || this.ram() || this.gpu()) {
alert('Price increased!');
}
});
}
}