JSPM

attr-brick

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q23883F
  • License MIT

Lego plugin to bind node properties to a store attribute

Package Exports

  • attr-brick

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (attr-brick) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

attr-plugin

Lego plugin to bind a node attribute with a store attribute

Installation

with component:

$ component install bredele/attr-brick

with nodejs:

$ component install attr-brick

Usage

First, add the plugin to your view (see lego to know more about views):

view.add('data-attr', require('attr-brick'));

Basic

<a data-attr="href, github"></a>

The plugin will look if it finds the property github and listen for changes.

view.set('github', 'http://github.com/bredele');

will display:

<a href="http://github.com/bredele"></a>

see live example

Alternative

lego allows variable substitutions

<a href="{{ github }}"></a>

License

MIT