Vladimirs
Vladimirs

Reputation: 8609

Knockout js for attribute binding in IE8

Can't bind for attribute in IE8

http://jsfiddle.net/k2Mq7/ - ko 2.1:

SCRIPT5022: Unable to parse bindings.
Message: SyntaxError: Expected identifier, string or number;
Bindings value: attr: { id: 'that-works', for: 'but-than-not' } 

http://jsfiddle.net/k2Mq7/3/ - ko 2.1 quoted for ('for'):

jsfiddle fails but on my local machine no any errors but this label displayed without for attribute.

Is it Knockoutjs bug or that I am doing something wrong?

Upvotes: 0

Views: 544

Answers (1)

johnnyno
johnnyno

Reputation: 608

Use quotation marks for attributes names like this:

<label data-bind="attr: { 'for': vmProperty }"></label>

Upvotes: 2

Related Questions