basically have bunch of form fields (input, textarea, select, etc.). no <form> , no field names per say.
eg (extract dom notice classes when maxlength exceeded):
<textarea placeholder="enter name new task" data-ng-model="task.title" data-ng-maxlength="350" class="ng-touched ng-dirty ng-valid-parse ng-invalid ng-invalid-maxlength"></textarea> relatively straight forward in term of html. want use angular's ng-maxlength visually display error message.
i aware there $scope.{form_name}.{field_name}.$error since don't have either form , field names resulting in error.
$scope.$error - results in undefined.
$scope.form.error - resulted in error because of no <from>.
$scope.task_title.$error - result in error because of no <form>.
should stick jquery watching ng-invalid or ng-invalid-maxlength. or there still way track in controller?
Comments
Post a Comment