0

I am using below syntax ,

<span ng-repeat="item in basicProductInformation.productName">
        <input ng-show="currentLoggedInCompanyId == '566019bbb356de9283ded176'" ng-class="{errElementBorder: item.valueErr && !item.value}" class="form-control input-sm"  type="text"  ng-model="item.value" maxlength="500" ng-readonly="ValuesReadOnly"  style="height: 34px;">
        <input ng-hide="currentLoggedInCompanyId == '566019bbb356de9283ded176'" ng-class="{errElementBorder: item.valueErr && !item.value}" class="form-control input-sm"  type="text"  ng-model="item.value" maxlength="80" ng-readonly="ValuesReadOnly"  style="height: 34px;">
</span>

It is always taking maxlength of 80 after saving the changes nothing will be shown on UI for the first ng-show condition

For second input box (ng-hide) the text will be saved correctly and correctly shown on UI

Please suggest me if I did anything wrong?

J1617
  • 91
  • 1
  • 10

1 Answers1

0

Try using ng-maxlength. Here's the AngularJS documentation ngMaxlength.

And on your condition statement, try using '===' instead of '=='. There's a difference in comparing between the two because the '==' uses a type conversion. Read this thread.

JP Dolocanog
  • 451
  • 3
  • 19
  • I have tried '===' in all condition but still it allows me to enter more than specified charecters in input box – J1617 Nov 03 '17 at 07:54
  • Can you post a working fiddle regarding your problem? P.S. my advice is to always use '===' on your comparison. – JP Dolocanog Nov 03 '17 at 07:55