Skip to content

Commit

Permalink
0.0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
bahrus committed Mar 9, 2024
1 parent 0627390 commit 476c750
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ Sample markup:
<newton-microservice
for="operation expression"
be-fetching oninput="({operation, expression}) => ({
url: `https://newton.now.sh/api/v2/${operation}/${expression}`
//can also hard code href attribute if it is a constant
href: `https://newton.now.sh/api/v2/${operation}/${expression}`
})"
onload="({data}) => {
//optional
return data.map(item => {label: item.description, value: item.id})
}
target=json-viewer[-object]
onerror="console.error(href)"
></newton-microservice>
Expand All @@ -83,7 +88,7 @@ To only recalculate it when focus is lost, add the onchange attribute.
<newton-microservice
for="operation expression"
oninput="({operation, expression}) => ({
url: `https://newton.now.sh/api/v2/${operation}/${expression`}`
href: `https://newton.now.sh/api/v2/${operation}/${expression`}`
})"
be-fetching onchange
target=json-viewer[-object]
Expand Down

0 comments on commit 476c750

Please sign in to comment.