This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ng-maxlength validator does not respect/allow negative values #9995
Closed
Description
The standard maxlength attribute on <input>
allows specifying a negative value to provide the default behaviour (i.e. unlimited length). For using a databound/dynamic value for ng-maxlength
, I need the ability to allow an unlimited length as an option. However, with the current code, if you add an ng-maxlength
attribute the only way to allow an unlimited length is to default it to some hardcoded very large value.
Ideally, I could do:
<input type="text" ng-maxlength="{{validation.maxlength || -1}}"></input>
And have it work as expected. Currently, with 1.3.1, this results in an invalid input regardless of the length.