Triggering beforeRemove, afterAdd handlers in KnockoutJS

Triggering beforeRemove, afterAdd handlers in KnockoutJS

Asked on December 31, 2018 in knockout js.
Add Comment


  • 1 Answer(s)

        This is the required details.

    Use this code :

    data-bind='foreach: { data: items, beforeRemove: onRemove }'
    

        Before Remove is an option that is accepted by the foreach  binding. It was being treated as a separate binding in the way that you were specifying it . It is ignored If a binding does not exist

        The function will get called once for each node in the “template”. Now, It will be a text node, the li, and another text node. If  the text nodes is forget , then check that the element’s nodeType is 1.

    Answered on December 31, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.