1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Can I still use ngChanges with signals?

Discussão em 'Angular' iniciado por Richard77, Agosto 4, 2025.

  1. Richard77

    Richard77 Guest

    With the traditional @Input() decorator, one can use the ngChanges to do something if the value change. In this case, I'm using a component in the ng-bootstrap modal. The modal contains a form. When the item to edit is selected, it's passed to the component that's in the modal.

    @Input() inputVar!: SomeType;

    ngOnChanges(changes: SimpleChanges): void {
    const chInputVar = changes['inputVar'];

    //Do something when the value changes...
    }


    Now, I'd like to use the signal input:

    inputVar = input<SomeType>();
    //How to act when the value changes?

    Continue reading...

Compartilhe esta Página