jquery-template icon indicating copy to clipboard operation
jquery-template copied to clipboard

Bug on external url templates when used on nested template.

Open jhnmrls opened this issue 9 years ago • 2 comments
trafficstars

I found a bug on

<div data-content="comments" data-format="nestedTemplateFormatter" data-format-options='{"template":"assets/templates/comment_nested_template.html"}' ></div>

This doesn't work,

However there's a workaround via inline script

<div data-content="comments" data-format="nestedTemplateFormatter" data-format-options='{"template":"#comment_nested_template"}' ></div>

Note: I'm sure the link is correct because this one loads properly:

$('#posts').loadTemplate("assets/templates/post.html",{ },{});

there must be a problem on

handleTemplateLoadingSuccess function

jhnmrls avatar Sep 28 '16 08:09 jhnmrls

Hey! I ran in the same issue and invesigated a bit more.

It seems to be some kind of racecondition. A quick (and dirty) workaround is to add internalSettings.async = false to addTemplateFormatter("nestedTemplateFormatter", ... ).

A propper fix would require to provide an asyncronous addTemplateFormatter.

iLennart21 avatar Nov 09 '16 08:11 iLennart21

ok I'll look into this when I get the time.

codepb avatar Nov 10 '16 19:11 codepb