Skip to content

Commit d204c74

Browse files
committed
update
1 parent fc8d3b3 commit d204c74

75 files changed

Lines changed: 3482 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import mapToTemplate from 'ehtml/actions/mapToTemplate'
2+
3+
export default (node) => {
4+
if (!node.hasAttribute('data-item-name')) {
5+
throw new Error('<template is="e-for-each"> must contain attribute "data-item-name"')
6+
}
7+
const wrapTemplate = document.createElement('template')
8+
const clonedNode = node.cloneNode(true)
9+
clonedNode.observedByEHTML = true
10+
wrapTemplate.content.appendChild(clonedNode)
11+
node.parentNode.replaceChild(wrapTemplate, node)
12+
mapToTemplate(wrapTemplate)
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import evaluatedStringWithParamsFromState from 'ehtml/evaluatedStringWithParamsFromState'
2+
3+
export default (node) => {
4+
node.style.display = 'none'
5+
node.name = node.getAttribute('name')
6+
node.value = () => {
7+
return evaluatedStringWithParamsFromState(
8+
node.getAttribute('data-bound-to'),
9+
node.__ehtmlState__,
10+
node
11+
)
12+
}
13+
}

0 commit comments

Comments
 (0)