Skip to main content

Bug Tracker

Side navigation

#7689 closed bug (worksforme)

Opened December 03, 2010 09:14AM UTC

Closed December 03, 2010 05:27PM UTC

Last modified December 06, 2010 10:28AM UTC

$.format doesn't work inside {{= }}

Reported by: nfplee@hotmail.com Owned by: nfplee@hotmail.com
Priority: undecided Milestone: 1.6
Component: templates Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

The summary basically says it all. You can say:

{{= format(...) }}

Where format is simply a function defined to simply call $.format. But you cannot say:

{{= $.format(...) }}

This seems odd that two plugins both developed by the same people conflict in this way.

Attachments (0)
Change History (4)

Changed December 03, 2010 10:59AM UTC by jitter comment:1

owner: → nfplee@hotmail.com
status: newpending

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

We require that all bug reports include a valid reduced test case, which reproduces the issue you are experiencing, on http://jsfiddle.net. This enables us to more easily investigate this issue further.

Changed December 03, 2010 05:27PM UTC by danheberden comment:2

_comment0: Perhaps you're using an old version of tmpl? [https://github.com/jquery/jquery-tmpl] \ \ Using both the {{=}} and ${} notation, the expression runs as expected. \ \ Demo: [http://jsfiddle.net/danheberden/CC5Qy/] \ \ Also, it's worth noting the additional variables available in side of ${} - see [http://api.jquery.com/template-tag-equal/] (The $item and $data Template Variables heading) \ 1291397256695671
resolution: → worksforme
status: pendingclosed

Perhaps you're using an old version of tmpl? https://github.com/jquery/jquery-tmpl

Using both the {{=}} and ${} notation, the expression runs as expected.

Demo: http://jsfiddle.net/danheberden/CC5Qy/

Also, it's worth noting the additional variables available inside of ${} - see http://api.jquery.com/template-tag-equal/ (The $item and $data Template Variables heading)

Changed December 06, 2010 09:26AM UTC by anonymous comment:3

Cheers, i can confirm this works with latest version. I was using the one hosted on the Microsoft CDN.

Changed December 06, 2010 10:28AM UTC by jitter comment:4

component: unfiledtemplates