   removeItem: (index) ->
     (e) =>
       value = if @props.destroyWorkaround and @props.value[index]?.id
+        id:       @props.value[index]?.id
         _destroy: '1'
       else
         null

        onClick: @addItem

    # Due to the fact that we have a destroyWorkaround we can't trust that the index
    # represents the true representation of the first element. We'll store the first non-destoryed
    # index so that children can conditionally render remove buttons etc.
    firstPersistedRecordIndex = (index for prop,index in @props.value when prop?._destroy isnt '1' or not prop.val)?[0]

    # since the real "index" includes destroyed items, pass a displayIndex showing where this item is
    # in the list of subforms being displayed. Not zero-indexed (since it's for display purposes)

      if _.isEmpty @props.permittedProperties
        _.cloneDeep @props.value
      else
        (_.pick v, @props.permittedProperties for v in @props.value when v isnt null)

    @props.onChange @props.name, value

