0
角度2でjquery検証エンジンを使用するには? 2角度(NPM使用中角度2のjquery検証エンジン
<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">
そしてインストールjqueryの--save jqueryの をインストールし、::今はまだ
npm install @types/[email protected] --save-dev)
そして、それがない私はjqueryの検証のindex.htmlファイル内のファイルを含ま作業。
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>
私のTSコード
constructor(){
$(document).ready(function(){
$("#idofurform").validationEngine();
});
}
エラーを表示しています[ts]プロパティ 'validationEngine'が 'JQuery'型に存在しません。 /home/midhilaj/Desktop/angularhost3/src/app/components/home.component.ts (25,23)で
ERROR:プロパティ 'validationEngineは、' タイプ 'はJQuery' に存在しません。 のWebPACK:
は、CLIを使用していますか? –
はい、私はcliを使用しています –
あなたは角度cli .jsonファイルのスクリプトでファイルをエクスポートする必要があると思うそれは動作します –