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

How to delete an item in an immutable signal array or a key/value in a signal object?

Discussão em 'Angular' iniciado por Juergen Gross, Julho 8, 2025.

  1. To update items into an immutable array, we can easily do:

    array = signal([1,2,3]);
    ...

    ...
    this.array.update(item => [ ...item, 'newItem' ]);


    To update items into an immutable object easily do:

    object = signal({});
    ...

    ...
    this.object.update(obj => ({ ...obj, key :'newValue' }))


    But how to delete some items of an array. Also please refer to demo@stackblitz

    Continue reading...

Compartilhe esta Página