repeat-brick

0.0.1 • Public • Published

Repeat

Loop over the items of an array store and append bound instances of that element. Repeat is also a plugin for lego.

Installation

with component:

$ component install bredele/repeat-brick

with nodejs:

$ npm install repeat-brick

Usage

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

  var repeat = require('repeat-brick');
 
  view.add('repeat', repeat(view));

Basic

  <ul repeat>
    <li>{{ attr }}</li>
  </ul>

the 'li' is repeated for each item into the store (view is a store)

update the store :

view.reset([{
  attr: 'bredele',
}, {
  attr: 'Calgary'
}])

and here's the result:

  <ul list>
    <li>bredele</li>
    <li>Calgary</li>    
  </ul>

See example.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    0

Package Sidebar

Install

npm i repeat-brick

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • bredele