Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbjorge/jazzdot
https://github.com/jbjorge/jazzdot
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jbjorge/jazzdot
- Owner: jbjorge
- Created: 2015-11-01T13:14:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-01T14:52:54.000Z (about 9 years ago)
- Last Synced: 2024-10-12T05:07:01.457Z (3 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# jazzdot
Converts html-templates made with gulp-jazzdot to html-elements.
## How to use it
Write your template in HTML and save it with the extension `.tpl.html`.
Add the attribute `data-id` if you want make an element reachable from your code.
```html
This button is exposed
This button is not exposed
```## API
Assuming we saved the previous template under `frontPage/frontView.tpl.html`.
```js
var view = require('jazzdot')('frontPage/frontView'); //fetch the view
```### .activate(HTMLElement)
This appends the template html to a HTML element.### .populate(object)
This function accepts an object with `{key: value}` and `{key: [value1, value2, ...]}`.
Value can be of type HTML-element or text.### .deactivate()
This removes the template html from the HTML element.### .yourprop
All the elements exposed with `data-id=` are directly available on the view as HTML elements.