Skip to content

ringo22/handlebarsCompile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Handlebars compile plugin

Simple use

  • template: is a handlebars template to use
  • container: where to insert the compiled code
  • content: data we are sent to the template
	$('#template').handlebarsCompile({ container: '#content', content: { firstName: "Alan", lastName: "Johnson" }  });

Actions to insert the content

Add 'action' parameter (replace, prepend, append)

  • Replace: replace the content
  • Prepend: add content to the top
  • Append: add content to the end
	// Replace content
	$('#template').handlebarsCompile({ container: '#content', content: { firstName: "Alan", lastName: "Johnson" }, action: 'insert' });
	
	// Append into content
	$('#template').handlebarsCompile({ container: '#content ul', content: { firstName: "Maria", lastName: "Helder" }, action: 'append' });
	
	// Prepend into content
	$('#template').handlebarsCompile({ container: '#content ul', content: { firstName: "Robin", lastName: "Hackman" }, action: 'prepend' });

About

With this plugin I help to compile your code of handlebars

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published