When binding to templates, many examples use the following syntax: ${startDate} and #= startDate #. There does not seem to be a difference and the use is inconsistent. The docs does not shed any light on this. Which one is recommended and is there a difference?
Asked
Active
Viewed 107 times
2 Answers
0
There is no difference between these two usage
${startDate}
- this is jquery template style(this is also supported by kendo ) to render literal
#= startDate #
- this is kendo template style to rendering literal values

Arun Killu
- 13,581
- 5
- 34
- 61
-
So no difference? Is the first one obsolete? – TruMan1 Jul 25 '13 at 10:34
0
The difference between ${startDate} and #= startDate # is that the first one will encode any HTML entities contained in startDate
. The latter will embed the HTML tags in the page. It is recommended to use ${startDate}.
In short
${startDate}
when startDate == "<strong>foo</strong>"
will output "<strong>foo</strong>"
#= startDate #
when startDate == "<strong>foo</strong>"
will output "<strong>foo</strong>"

Atanas Korchev
- 30,562
- 8
- 59
- 93