0

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?

TruMan1
  • 33,665
  • 59
  • 184
  • 335

2 Answers2

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

example

Arun Killu
  • 13,581
  • 5
  • 34
  • 61
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 "&lt;strong&gt;foo&lt;/strong&gt;"

#= startDate # when startDate == "<strong>foo</strong>" will output "<strong>foo</strong>"

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