डाउनलोड पी.डी.एफ. ई-बुक्स
AJS - Directives ng-minlength

ng-minlength directive ये HTML Element पर maxlength attribute को add या replace कर देता है |

ng-minlength directive ये editable elements(<input>, <textarea>) के लिए इस्तेमाल किया जाता है |


Syntax for ng-minlength Directive in AngularJS

<element ng-minlength="charLength">
</element>

ng-minlength Attribute's Parameters in AngularJS

charLength : यहाँ पर minimum characters की length दी जाती है |


Example for ng-minlength Directive using String in AngularJS

Source Code :
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
</head>
<body>

<div ng-app="">

<form name="Form">

<input name="name" ng-model="myinput" ng-minlength="10" />

<p ng-if="Form.name.$invalid">Enter Minimum 10 characters</p>

</form>

</div>

</body>
</html>
Output :

Enter Minimum 10 characters