Skip to content

Minor Parsing issue with data-link #476

Description

@BrentH-Alnico

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions