replace

  • function
2.0.4
 

Replaces one element with some content while keeping [can.view.live.nodeLists nodeLists] data correct.

live.replace(nodes, val, teardown) 2.0.4

Replaces one element with some content while keeping [can.view.live.nodeLists nodeLists] data correct.

Parameters

  1. nodes {Array<HTMLElement>}

    An array of elements. There should typically be one element.

  2. val {String | HTMLElement | DocumentFragment}

    The content that should replace nodes. If a string is passed, it will be hookedup.

  3. teardown {function()}Optional

    A callback if these elements are torn down.