I'm currently working on developing custom form validation, utilizing ng-class to emphasize required fields. Here is the syntax I am using:
<div class="form-group"
ng-class="{'has-error': dc.{fname}.nedatt({{fname}}.username)}">
<input class="form-control" name="username" type="text" placeholder="Username"
ng-required="true" ng-model="f1username"/>
<span class="help-block" ng-show="{{fname}}.username.$error.required">Required</span>
</div>
When applying ng-class, I encounter the following error message:
Error: [$parse:syntax]
http://errors.angularjs.org/1.3.3/$parse/syntax?p0=.&p1=not%20a%20primary%20expression&p2=1&p3=.username.%24error.required&p4=.username.%24error.required
And when configuring the help block, I receive this error:
SyntaxError: Unexpected token ;
I am using fname
as a placeholder for the form's name which will be replaced later, hence encapsulating it within {{}}
. Any assistance in resolving these issues would be greatly appreciated as I am currently stuck.