<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" >
how to pass null value or remove the functionality maxlength attribute when maxLen == false
CodePudding user response:
Instead of using property binding, make use of attribute binding as below:
[attr.maxlength]="maxLen ? 250 : null"
CodePudding user response:
It is maxlength not maxLength. Try below
[maxlength]="maxLen == true ? 250 : null"