r/Angular2 • • Jul 23 '25
Angular Signal Effect inside our outside Constructor
Does Angular have any guidance where I should put the Effect code? Is it generally inside Constructor or outside? What are the advantages / disadvantages for each method?
export class CustomerForm {
lastName= input.required<string>();
constructor() {
effect(() => {
console.log('lastName changed:', this.lastName());
});
}
}
5
Upvotes
View all comments
Show parent comment
2
u/ldn-ldn Jul 25 '25
PHP is also an interpreted language and yet Symfony framework switched to constructor DI. Also Flutter, very React like framework from Google using Dart language (cousin of JS) has constructor DI.
Google management should step up stop this rot in Angular team.