Skip to content
a simple object for managing html templates with javascript
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/js
LICENSE
Label.js
README.md

README.md

Labels

0.0.6

This is a drop-dead simple approach to handling html templates. It is essentially a pojo - a plain old javascript object - that accepts classes to manage api requests and configurations concerning templates.

Dependencies

planner - for pubsub events.

store - or any third-party api request library.

Example

  // @todo refactor
  var templates = {
  	menu: (data) => {
  		return 'an html template'
  	}
  }

  var el = new Label({
  	   manage: Manager,
  	   fn: 'findAll',
  	   container: document.getElementByName('menu'),
   	   template: templates.menu,
  	   name: 'menu'
  	})

    // ...

  	el.render()

API Methods

request

manually request the template data

render

requests template data and renders the html template the container element

renderAsync

manually send render a template with asynchronously requested data

You can’t perform that action at this time.