-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'init' of null at angular-validator.js:143 #49
Comments
Hi Amit, what's your template look like?
formSubmit has to be the form name or a validation group |
Hi, Thanks for replying, the template is like - template is https://jsfiddle.net/qbhrk6dq/ Not sure if AngularJS v1.3.15 is causing an issue. I appreciate your help. Thanks, |
Try to give your form a name <form name="FORM_NAME" class="form-horizontal panel-body">
<input type="text" ng-model="formSubmit.required" validator="[required]" validator-group="GROUP_NAME">
</form> and then pass it to the validateFn $validator.validate($scope, 'FORM_NAME') or use validator-group on the element and pass the group name to the validatFn $validator.validate($scope, 'GROUP_NAME') It's not an Angular 1.3 issue iam using without any problems. |
Hello, It worked! :) 👍 Thank you so much for your help. I tried using $validator.validate($scope, 'FORM_NAME') and it didn't work, it doesn't do any validation. But when i use $validator.validate($scope, 'GROUP_NAME') instead, it works for me. Is there any main difference between these two? Will that also work for radio, select, textarea elements too? Please let me know. Thanks again. Amit |
I'm using AngularJS v1.3.15 and I've included following on my html document
<script src="~/App/angular-validator.js"></script>
<script src="~/App/angular-validator-rules.js"></script>
This is what's in there in App.js
This is what i've on User.js
angular
.module('User.Account', ['ngSanitize', 'ui.bootstrap', 'dialogs.main', 'ui.router'])
.controller('Account', Account);
}
When i run the project, it gives me following error
TypeError: Cannot read property 'init' of null
at angular-validator.js:143
typeof rule.init // shows undefined
Please let me know if i'm missing something. I would appreciate any help.
Thanks,
Amit
The text was updated successfully, but these errors were encountered: