0

I always encounter the double mustache notation {{}} in JavaScript Template engine.

Why not only one?

dmail
  • 23
  • 7

2 Answers2

1

Probably because they want easily distinguish Javascript object notation (single parenthesis) from template-related variables/expressions (double parenthesis: {{}}).

WTK
  • 16,583
  • 6
  • 35
  • 45
1

It is about as much of an arbitrary design choice as can get. It definately wouldn't make sense to use {} as this is standard object notation, and you can in fact find notation like this in your HTML code if you are using Knockout.js.

Template could be signified by any marking at all, <??>, [[]],!><!, and in fact most template engines you can customize to use those if you prefer.

Code Whisperer
  • 22,959
  • 20
  • 67
  • 85
  • See http://stackoverflow.com/questions/8302928/angularjs-with-django-conflicting-template-tags for how to customize the notation in angular. – dnc253 Jul 30 '13 at 14:35