0.0.2 • Published 3 years ago

any-src v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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?