How to use jquery validation engine in angular 2? I included jquery validation files in index.html file:
<script src="http://localhost/2017/js2/jquery.validationEngine.js" type="text/javascript"></script>
<script src="http://localhost/2017/js2/jquery.validationEngine-en.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://localhost/2017/css2/validationEngine.jquery.css">
And installed jquery in angular 2 (using npm install --save jquery and:
npm install @types/jquery@2.0.47 --save-dev )
And still now it is not working.
form code <br>`<form id="idofurform" name="idofurform">
<input id="stdname" class="validate[ required,custom[onlyLetterNumber]] text-input form-control" type="text" name="stdname" placeholder="student name">
<!--onkeyup = "onlyNumbers(this.id,0,25)"-->
<input id="stdage" type="number" name="stdage" class="validate[custom[onlyNumberSp], required, custom[number],min[10],max[25]] form-control" placeholder="student age">
<input class="validate[ required, custom[email]] form-control" type="email" id="stdemail" name="stdemail" placeholder="student email">
<!-- onkeyup = "onlyNumbers(this.id,0,1000000000000)" -->
<input maxlength="10" class="validate[custom[onlyNumberSp],required,maxSize[10],minSize[10], custom[phone]] text-input form-control" name="stdphone" id="stdphone" type="phone" name="stdphone" class="form-control">
</form>
my ts code
constructor(){
$(document).ready(function(){
$("#idofurform").validationEngine();
});
}
It showing error [ts] Property 'validationEngine' does not exist on type 'JQuery'.
ERROR in /home/midhilaj/Desktop/angularhost3/src/app/components/home.component.ts (25,23): Property 'validationEngine' does not exist on type 'JQuery'. webpack: Failed to compile
again ERROR in multi script-loader!./src/src/assets/jquery.validationEngine.js – Jul 12 '17 at 11:27