Skip to content

matthewstokeley/js-labels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

a simple object for managing html templates with javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published