Using # binding for variables in Lightning shows as error

Issue #1176 resolved
Tony White created an issue

Displays as 'Wrong attribute value', it was fine from memory before the last update.

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/expr_data_binding.htm

                                <aura:if isTrue="{#v.internalView}">
                                    There were related addresses found for your search.
                                    Confirm the address you want to proceed with.
                                </aura:if>

Comments (6)

  1. Scott Wells repo owner

    Tony, I fixed a bug in the last update that was caused by a recent regression in IntelliJ IDEA/WebStorm. That bug was causing {!..} and {#..} expressions in attribute values as string literals not to be properly processed as the embedded markup expression language. I believe the problem you're seeing now is because the base IDE knows that aura:if > isTrue must be of type xsd:boolean, and it doesn't think that the expression evaluates to that data type. What I've had to do in the past is suppress these types of errors since there's no way for me to communicate the evaluated expression type to the enclosing XML/XSD parser. I'll take a look in an upcoming release at how I might do that.

  2. Log in to comment