SteveSanderson/knockout — Issue #177: data-bind parse error with }}
Author: mcz
Created: 2011-10-18 21:48:27+00:00
State: open

Hi guys,

When I create an element in a template like this:

```html

```

I get an error

```
Uncaught SyntaxError: Unexpected token )

buildTmplFn jquery.tmpl.js:317
jQuery.extend.template jquery.tmpl.js:180
ko.jqueryTmplTemplateEngine.renderTemplate knockout-1.2.1.debug.js:2153
executeTemplate knockout-1.2.1.debug.js:1783
ko.renderTemplateForEach.ko.dependentObservable.disposeWhenNodeIsRemoved knockout-1.2.1.debug.js:1856
ko.dependentObservable.disposeWhenNodeIsRemoved knockout-1.2.1.debug.js:1989
evaluate knockout-1.2.1.debug.js:927
ko.dependentObservable knockout-1.2.1.debug.js:965
mapNodeAndRefreshWhenChanged knockout-1.2.1.debug.js:1988
ko.utils.setDomNodeChildrenFromArrayMapping knockout-1.2.1.debug.js:2046
ko.renderTemplateForEach.ko.dependentObservable.disposeWhenNodeIsRemoved knockout-1.2.1.debug.js:1852
evaluate knockout-1.2.1.debug.js:927
ko.dependentObservable knockout-1.2.1.debug.js:965
ko.renderTemplateForEach knockout-1.2.1.debug.js:1842
ko.bindingHandlers.template.update knockout-1.2.1.debug.js:1877
invokeBindingHandler knockout-1.2.1.debug.js:1231
ko.applyBindingsToNode.ko.dependentObservable.disposeWhenNodeIsRemoved knockout-1.2.1.debug.js:1268
evaluate knockout-1.2.1.debug.js:927
ko.dependentObservable knockout-1.2.1.debug.js:965
ko.applyBindingsToNode knockout-1.2.1.debug.js:1272
ko.applyBindings knockout-1.2.1.debug.js:1284
ko.utils.arrayForEach knockout-1.2.1.debug.js:48
ko.applyBindings knockout-1.2.1.debug.js:1283
(anonymous function) app.js:178
jQuery.extend._Deferred.deferred.resolveWith jquery-1.6.4.js:1016
jQuery.extend.ready jquery-1.6.4.js:437
DOMContentLoaded jquery-1.6.4.js:923
```

But when I modify it to ... notice the space between the two }} at the and of the bindig:

```html

```

Everything works fine.