I'm learning AngularJS
and came up with this issue:
<div ng-controller="MainCtrl as ctrl">
<form ng-submit="ctrl.submit()" name="myForm">
<input type="text"
ng-model="ctrl.user.username"
ng-pattern="/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/"
ng-required="true"
ng-minlength="4">
<input type="password"
ng-model="ctrl.user.password"
ng-required="true">
<input type="submit"
value="Submit"
ng-disabled="myForm.$invalid">
</form>
In the statement "ng-pattern="/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/"
I wanted to use '@'
but I can not. I have tried @@
but it's also not working. It's giving me this error:
"[" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid.