1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

What are the implication with 2-way binding using signals versus using plain properties in...

Discussão em 'Angular' iniciado por Konrad Viltersten, Outubro 26, 2024 às 06:02.

  1. According to the documentation, I can create a 2-way binding using plain properties but also using signals.

    It doesn't explain the pros nor cons implied by either choice.

    I can conclude myself that if I want the parent component to act according to a signal (regardless of the binding to its child) I should use signal (and vice versa). But I wonder if that's all there's to it. I suspect that there are deeper implications that may be a future butt-biter.

    What are the implied caveats of applying/rejecting signals for two-way bindings between components?

    @Component({ template: '<app-child [(beep)]="beep" />', ... })
    export class Parent { protected beep = signal("signals"); }

    @Component({ template: '<app-child [(beep)]="beep" />', ... })
    export class Parent { protected beep = "plain props"; }

    Continue reading...

Compartilhe esta Página