gpt4 book ai didi

Angular Material TimePicker ngx-material-timepicker 错误未捕获( promise ): TypeError: Object(. ..)不是函数

转载 作者:行者123 更新时间:2023-12-02 17:00:13 25 4
gpt4 key购买 nike

我使用 ngx-material-timepicker timePicker 从 here 安装使用命令npm install --save ngx-material-timepicker我还安装了依赖项 luxon 和 tslib并根据 npm

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

在我的 html 文件中

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

但是错误

core.js:15724 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function
TypeError: Object(...) is not a function
at ngx-material-timepicker.js:231
at Module../node_modules/ngx-material-timepicker/fesm5/ngx-material-timepicker.js (ngx-material-timepicker.js:238)
at __webpack_require__ (bootstrap:83)
at Module../src/app/modules/management/admin/admin.module.ts (admin-routing.module.ts:145)
at __webpack_require__ (bootstrap:83)
at $_lazy_route_resource lazy namespace object:34
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Object.onInvoke (core.js:17299)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150)
at resolvePromise (zone.js:831)
at resolvePromise (zone.js:788)
at zone.js:892
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at drainMicroTaskQueue (zone.js:601)

最佳答案

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

关于 Angular Material TimePicker ngx-material-timepicker 错误未捕获( promise ): TypeError: Object(. ..)不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57158964/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com