Hi Boris,
I have a case where I tried doing this...
data-link="disabled{:~inObjectArray(array, {'key1': val1, 'key2': val2})}"
...which resulted in a syntax error likely due to inner curly braces.
However, this method works; but of course cannot be used on two-way data-bound tags.
disabled="{{:~inObjectArray(array, {'key1': val1, 'key2': val2})}}"
One work-around
data-link="disabled{:~inObjectArray(array, 'key1', val1, 'key2', val2)}"
inObjectArray: function(array, key1, val1, key2, val2) {
return array.some(obj => obj[key1] == val1 && obj[key2] == val2);
}
Here is a test file: https://jsfiddle.net/alnico/e8pgm3k0/
I know the parsing code is quite complex, hopefully this is fixable, but if not, no big deal.
Hi Boris,
I have a case where I tried doing this...
data-link="disabled{:~inObjectArray(array, {'key1': val1, 'key2': val2})}"...which resulted in a syntax error likely due to inner curly braces.
However, this method works; but of course cannot be used on two-way data-bound tags.
disabled="{{:~inObjectArray(array, {'key1': val1, 'key2': val2})}}"One work-around
data-link="disabled{:~inObjectArray(array, 'key1', val1, 'key2', val2)}"Here is a test file: https://jsfiddle.net/alnico/e8pgm3k0/
I know the parsing code is quite complex, hopefully this is fixable, but if not, no big deal.