Skip to content

Instantly share code, notes, and snippets.

@QuincyLarson
Created May 6, 2014 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QuincyLarson/b0abb26621c98d15f839 to your computer and use it in GitHub Desktop.
Save QuincyLarson/b0abb26621c98d15f839 to your computer and use it in GitHub Desktop.
before
var template = Hogan.compile('<div class="hit-auto-complete col-md-12">' +
'<div class="row">' +
'<img class="col-lg-1 col-md-1 col-sm-2 col-xs-2" src="http://ecx.images-amazon.com/images/I/{{{i}}}._SL100_.jpg"</img></td>' +
'<div class="typeahead-product-name col-lg-11 col-md-11 col-sm-10 col-xs-10">{{{_highlightResult.p.value}}}</div>' +
'<div class="typeahead-transcript col-lg-11 col-md-11 col-sm-10 col-xs-10">{{{_highlightResult.t.value}}}</div>' +
'<div class="id" style="display: none;">{{{objectID}}}</div>' +
'</div>' +
'</div>');
after (doesn't work):
var template = Hogan.compile('<div class="hit-auto-complete col-md-12">' +
'<div class="row">' +
'<img class="col-lg-1 col-md-1 col-sm-2 col-xs-2" src="http://ecx.images-amazon.com/images/I/{{{i}}}._SL100_.jpg"</img></td>' +
'<div class="typeahead-product-name col-lg-11 col-md-11 col-sm-10 col-xs-10">{{{_highlightResult.p.value}}}</div>' +
'<div class="typeahead-transcript col-lg-11 col-md-11 col-sm-10 col-xs-10">{{{_highlightResult.t.value.substring(0, t.length - 4)}}}</div>' +
'<div class="id" style="display: none;">{{{objectID}}}</div>' +
'</div>' +
'</div>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment