We ran into issue with the syntax while trying to run karma/jasmine/angularjs directive unit test that is testing a directive containing a snippet that is using angular-exeditable plugin.
The error we got was:
"Syntax error, unrecognized expression: form[name='foobar'"
The fix for us was simple, it's adding another set of quotes on line 1322 in xeditable.js
Error line:
} else if (elem && typeof elem.parents === "function" && elem.parents().last().find('form[name='+attrs.eForm+']').length) { // form exists below or not exist at all: check document.forms
Fixed line:
} else if (elem && typeof elem.parents === "function" && elem.parents().last().find('form[name="'+attrs.eForm+'"]').length) { // form exists below or not exist at all: check document.forms
Hello,
We ran into issue with the syntax while trying to run karma/jasmine/angularjs directive unit test that is testing a directive containing a snippet that is using angular-exeditable plugin.
The error we got was: "Syntax error, unrecognized expression: form[name='foobar'"
The fix for us was simple, it's adding another set of quotes on line 1322 in xeditable.js
Error line:
Fixed line:
Note the double quotes around
'+attrs.eForm+'
.The file that needs to be fixed is here: https://github.com/vitalets/angular-xeditable/blob/72a5c49d9309db1bdb18803a6e5837e51bc5a6b0/src/js/editable-element/directive.js, line 45
I wanted to submit a patch, but I failed to run unit tests locally on my mac following the instructions.