Search code examples
ractivejs

How to remove specific element from array with RactiveJs


I need to remove a specific element from the array (either by index or by object itself - doesn't matter). Seems like I'm blind but I don't see appropriate method in RactiveJs documentation. I found a method to remove an element from the beginning of the arrya (shift) or from the end of the array (pop) but don't see a method to remove specific element.


Solution

  • Seems like ractive.splice

    ractive.splice('myArray', indexToRemove, 1)
    

    is the way to go.