我想使用angular2-clockpicker,但出现错误。我遵循了Angular2 ClockPicker
上的说明我有角6.1.5
src / app / time-picker / clockpicker.directive.ts(14,34):错误TS2339:类型“ JQuery”上不存在属性“ clockpicker”。
import {Directive, ElementRef, OnInit} from "@angular/core";
import * as $ from 'jquery';
@Directive({
selector: '[appClockPicker]'
})
export class ClockPickerDirective implements OnInit {
constructor(private el: ElementRef) {}
ngOnInit(): void {
$(this.el.nativeElement).clockpicker({
placement: 'bottom',
align: 'center',
donetext: 'Done',
afterDone: () => {
console.log('done');
}
});
}
}