Hi Nico Give your input a *name*
e.g. <input type="text" name="settingsName" ng-model="settings.name" ng-minlength ="3" ng-maxlength="20" required /> and reference it as follows: myform.settingsName.$invalid For example: http://plnkr.co/edit/aAwc7A?p=info Regards Justin On Friday, October 17, 2014 3:50:45 PM UTC+2, Nico Madafaka wrote: > > Hi, > > Learning, so apologize in advance if a stupid question. > > In the below code, the error message will never show. > I know AJ's validation is correct, since when I output things with {{ > settings }}, the name value only show when I have more than 3 characters.. > > > <form name="myform"> > <input type="text" ng-model="settings.name" ng-minlength="3" > ng-maxlength="20" required /> > <div ng-show="myform.name.$invalid"> > this is an error, blah blah blah > </div> > > > Thanks in advance, > NM > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
