Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/instructure/ic-lazy-list
lazily loads remote records
https://github.com/instructure/ic-lazy-list
Last synced: 7 days ago
JSON representation
lazily loads remote records
- Host: GitHub
- URL: https://github.com/instructure/ic-lazy-list
- Owner: instructure
- Created: 2014-01-06T23:44:53.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-07-28T17:59:16.000Z (over 10 years ago)
- Last Synced: 2024-10-08T12:16:30.272Z (about 1 month ago)
- Language: JavaScript
- Size: 325 KB
- Stars: 5
- Watchers: 10
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ic-lazy-list
============Lazily loads records from an href as the user scrolls down the page, all
in your template.Installation
------------`npm install ic-lazy-list`
... or ...
`bower install ic-lazy-list`
... or just include `dist/main.js` into your app however you want.
Module Support
--------------- AMD
`define(['ic-lazy-list'], function() {});`
- Node.JS (CJS)
`require('ic-lazy-list')`
- Globals
`ic.LazyListComponent;`
All instructure canvas stuff lives on the `ic` global.
Usage
-----Once you've required ic-lazy-list into your application, you can use it
in your templates.```handlebars
{{#ic-lazy-list
href="http://addressbook-api.herokuapp.com/contacts"
data-key="contacts"
data=contacts
}}
- {{first}} {{last}}
{{#each contacts}}
{{/each}}
{{/ic-lazy-list}}
```
- `href` - the url to load
- `data-key` - optional, the key in the response your data lives on
- `data` - data-binding, when the data loads it will be bound to
whatever you map it to
Contributing
------------
After cloning this repo, install dependencies:
```sh
$ npm install
$ bower install
```
Fire up the grunt watcher:
```sh
$ grunt
```
Then in a different tab run the tests with testem:
```sh
$ testem
```