正在安装ngx-bootstrap-datetime-popup并出现错误

问题描述 投票:0回答:1

虽然已经安装了所有依赖项。

ERROR in node_modules/ngx-bootstrap-datetime-popup/dist/lib/ngx-bootstrap-datetime-popup.module.d.ts:2:22 - error NG6002: Appears in the NgModule.imports of AppModule, 
but could not be resolved to an NgModule class.

    This likely means that the library (ngx-bootstrap-datetime-popup) which declares DatetimePopupModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. 
Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

    2 export declare class DatetimePopupModule {

ts文件:

import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { DatepickerModule } from 'ngx-bootstrap/datepicker';
import { TimepickerModule } from 'ngx-bootstrap/timepicker';
import { DatetimePopupModule } from 'ngx-bootstrap-datetime-popup';
  imports: [
    BrowserModule,
    AppRoutingModule,
    BrowserAnimationsModule,
    BsDropdownModule.forRoot(),
    DatepickerModule.forRoot(),
    TimepickerModule.forRoot(),
    DatetimePopupModule.forRoot(),
    FormsModule
  ],

html:

<datetime-popup [(value)]="myDate" [closeButton]="myCloseOptions"></datetime-popup>

文档got here检查Demo here

我可以使用其他建议的其他日期时间选择器弹出窗口吗?

angular datetime ngx-bootstrap
1个回答
0
投票
如果尚未安装,请确保您使用的是最新版本的ngx-bootstrap。

[我刚刚将应用程序升级到Angular 9(使用Ivy),并且必须使用最新版本,但是它可以正常工作,包括datetime-popup。

© www.soinside.com 2019 - 2024. All rights reserved.