角材料TimePicker ngx-material-timepicker错误未捕获(承诺):TypeError:Object(...)不是函数

时间:2019-07-23 07:34:59

标签: angular timepicker material

我从here使用ngx-material-timepicker timePicker安装 使用命令$("div[name=Show_When_Closed]").on("click", function(){ $("div[name=Show_When_Closed]").hide(); //hide the divs whose name are Show_When_Closed $("div[name=Show_When_Open]").show(); //show the divs whose name are Show_When_Open }); 我也安装依赖项luxon和tslib 并根据npm

npm install --save ngx-material-timepicker

并在我的html文件中

   import {NgxMaterialTimepickerModule} from 'ngx-material-timepicker';
    @NgModule({
      imports: [NgxMaterialTimepickerModule]
    })

但出错

<input [ngxTimepicker]="picker">
<ngx-material-timepicker #picker></ngx-material-timepicker>

1 个答案:

答案 0 :(得分:0)

基于github issuethis,您可以使用3.3.1版的“ ngx-material-timepicker”,如果使用的是Angle 8,则可以使用v4.0.0版或转到{ {1}}并将/node_modules/ngx-material-timepicker/fesm5/ngx-material-timepicker.js更改为ɵɵdefineInjectable