-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional expressions without operators don't work properly (linq.ts BUG) #519
Comments
@jure123 Thanks for reporting this. This is a known issue and we have mentioned a note in most of the conditional expression example documentation, but missed on the disabled example. I keep this ticket in the open state, but no chance to fix this soon, as we have the alternative to work with conditional expression :). |
@ajayojha, thanks for your info. Indeed it is no big deal because we have a simple workaround :) |
+1 |
I found that linq.ts -> expressionParser() function has a bug with boolean expressions that don't use operators.
This conditional expression in @disable decorator does not work propery:
@disable({conditionalExpression: function () { return this.isChecked; }})
--> In this case linq espressionParser() extracts colum name "isChecked;" with included semicolon at the end which does not work
But it works if we put "== true" to the right side of the expression:
@disable({conditionalExpression: function () { return this.isChecked == true; }})
--> In this case linq espressionParser() extracts colum name "isChecked" (without semicolon which if correct of course)
You can try my example on stackblitz (clicking the button should toogle disable of textbox, but it does not work unless you append "== true" to the conditional expression:
https://stackblitz.com/edit/angular-z5p584?file=src%2Fapp%2Fuser.model.ts
BTW: The example below also does not work:
@disable({conditionalExpression: function () { return this.isChecked }})
I have removed the semicolon at the end of expression but the linq parsers still extracts column name "isChecked;" with semicolon (probably somewhere the code automatically adds semicolon to the end of expression)
@rxweb/reactive-form-validators 2.1.4
The text was updated successfully, but these errors were encountered: