In my current project, I am working on developing a custom directive that acts as a wrapper around an input field. The main purpose of this directive is to simplify formatting, encapsulate animations, and enhance overall functionality.
One of my goals for this directive is to integrate ngModel so that it can work seamlessly with other Angular directives like ng-maxlength and ng-required, depending on the ng-Model configuration.
To showcase my progress, I have created a Plunkr demo which can be accessed through this link: http://embed.plnkr.co/xV8IRqTmQmKEBhRhCfBQ/
However, I have encountered some issues in my implementation. Specifically, the ng-required directive is functioning correctly but only invalidates the entire form, rather than just the individual element itself (form.element.$invalid
remains false
). Additionally, the ng-maxlength/ng-minlength directives do not appear to have any effect at all.
If anyone has any insights or suggestions on what might be causing these problems, I would greatly appreciate your help. Thank you in advance for any guidance you can provide :)