I have already added a jquery library in to my angular-cli project but i also need to add jquery form validate plugin on the top of the jquery. I also want to integrate it with my component.ts file. how can i do this.
THANK YOU FOR YOUR HELP!
I have already added a jquery library in to my angular-cli project but i also need to add jquery form validate plugin on the top of the jquery. I also want to integrate it with my component.ts file. how can i do this.
THANK YOU FOR YOUR HELP!
First install jQuery using npm as follows
npm install jquery — save
Include it on your cli.json file
"scripts": [ "../node_modules/jquery/dist/jquery.min.js" ]
Import
import * from 'jquery';
(or)
declare var $: any;
Component
public ngOnInit()
{
$(document).ready(function(){
$("someclick").click(function(){
});
});
}