Created
June 22, 2014 11:51
-
-
Save jamesmichiemo/57fec3bf87c495162d1c to your computer and use it in GitHub Desktop.
an example for gathering JSON data for Handlebars templating
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source = $("#id_on_handlebars_script_tag").html() | |
| template = Handlebars.compile source | |
| $.getJSON('some route to json markup', (data)-> | |
| $("#content_placeholder").html(template data) | |
| ).error -> | |
| console.log "error" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment