any-src

0.0.2 • Public • Published

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?

Readme

Keywords

Package Sidebar

Install

npm i any-src

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

3.64 kB

Total Files

7

Last publish

Collaborators

  • xprmntl