Issue
In Angular 2+ (for example), I can use this syntax to disable a field conditionally:
<input [disabled]="booleanCondition" type="text">
In Svelte I'm trying to do as follows, but it doesn't work:
<input {booleanCondition ? 'disabled=""' : ''} type="text">
How can I do it?
Solution
<input disabled={booleanCondition}>
Answered By - Rich Harris
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.