is there any way to set char-counter maxlength dynamically for paper-input

184 views Asked by At

I want to set different maxlength for different data, i tried by writing a method in maxlength but it didn't worked, so is there any other possibility

<paper-input label="{{data.name}}" id="input" char-counter maxlength="getMaxLength()"></paper-input>
1

There are 1 answers

2
ksh On BEST ANSWER

use a property and set max length to property:

   <paper-input label="{{data.name}}" id="input" char-counter maxlength="[[maxValue]]"></paper-input>

use a method and return value from method:

   <paper-input label="{{data.name}}" id="input" char-counter maxlength="[[getMaxLength()]]"></paper-input>