any-src
v0.0.2
Published
any source web component
Downloads
1
Readme
any-src
Simple web-component provide src
attribute to enrich HTML templates.
Example
Data source
The following JSON
available at /data.json
end-point.
{
"sample": "Sample text",
"numeric": 120,
"image": "https://picsum.photos/100/100"
}
HTML
<any-src src="/data.json">
<p data-text="sample"></p>
<img data-src="image">
<div>
<input type="number" data-value="numeric">
</div>
</any-src>
TODO
- HTTP options for the fetch function
- loader support
- error handling?