Issue
<input type="text" #input *ngIf="!multiLine" [set-focus]="autoFocus" autocomplete="off" [value]="defaultValue" (input)="onChange()" [placeholder]="placeholder" [maxLength]="maxLen == true ? 250 : null"/>
this is my code but when i call it from another component and inspect maxLength is 0
<input _ngcontent-ueu-c888="" type="text" autocomplete="off" ng-reflect-set-focus="false" placeholder="Domain" maxlength="0" class="ng-star-inserted">

how to pass null value or remove the functionality maxlength attribute when maxLen == false
Solution
Instead of using property binding, make use of attribute binding as below:
[attr.maxlength]="maxLen ? 250 : null"
Answered By - Siddhant
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.