Some jquery plugins doesn't work with ionic framework


#1

Hi,
I want to implement clock picker similar to http://weareoutman.github.io/clockpicker/. I’ve been looking very vigorously for almost week now, but had no success. So I thought of integrating jquery clock picker plugin by
npm install clockpicker --save.
I followed all instructions given in https://medium.com/@NetanelBasal/typescript-integrate-jquery-plugin-in-your-project-e28c6887d8dc and I was able to integrate bootstrap-daterangepicker. So tought same instuctions will work for jquery clockpicker, but doesn’t work.

I ran this steps

npm install jquery --save

npm install @types/jquery --save

npm install clockpicker --save

import * as $ from ‘jquery’;
import ‘clockpicker’; //similar to import ‘bootstrap-daterangepicker’;
@Directive({
selector: “[clockpicker]”
})
class DaterangepickerDirective {
constructor(private el: ElementRef) {}
ngOnInit() {
$(this.el.nativeElement).clockpicker();
}
}

and finally included
interface JQuery {
clockpicker(options?: any, callback?: Function) : any;
}
in new typings.d.ts file which I added to src folder

I’m getting cannot find module clockpicker but I can see clockpicker in node modules

As I said earlier same insturctions work for bootstrap-daterangepicker but not for clockpicker. What am I missing.
Please help


#2

Wait until Ionic 4 to use jQuery. jQuery and Angular don’t play well together.


#3

Hi Aaron,
Thanks for quick response. When is official release date of ionic 4.