Attempting to create an angular directive that generates a label, input field, and validation code is causing some unexpected behavior.
Initially, I hardcoded the directive to include ng-minlength on the input element. This resulted in the model failing to bind properly. However, upon removing ng-minlength, the binding worked correctly.
Additionally, setting the name property to an attribute specified within the directive prevented error handling from functioning as expected.
The following Plunker provides an illustration of the issue:
http://plnkr.co/edit/BGxB5fENL5L6G7FcvPR5?p=preview
- Label1 - Highlights how hardcoding the name property enables error handling and showcases the issue with ng-minlength preventing model value binding.
- Label2 - Shows that removing ng-minlength allows for proper model value binding.
- Label3 - Demonstrates that dynamically binding the name property disrupts error handling.
Any assistance on this matter would be greatly appreciated. It seems like there might be a simple solution that I am overlooking, as examples of this specific scenario are scarce.