I just noticed that if i have a hyphen in the form name attribute or the input's name attribute, AngularJS validations don't work.
This doesn't work if i try to validate the fields
<form name="signup-form">
</form>
The below works perfectly
<form name="signupform">
</form>
Can someone please explain why AngularJs doesn't work in the first case? And if we were to have "-" work, how can we do that?
The problem is that the name you put into the name
attribute is also the name for the JavaScript property under which the form is published on the scope
(e.g. for using it inside your controller). An attribute name containing a hyphen is not valid JavaScript though. I'm pretty sure there is no way around it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With