- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
嘿,我试图将此库集成到我的 Angular 项目中,但出现以下错误:
/Users/.../node_modules/ngx-mui-datatables/ngx-mui-datatables.d.ts 中的模块“AppModule”导入的意外值“NgxMuiDatatablesModule in/Users/.../src/app/app.模块.ts'。请添加 @NgModule 注释。
该模块最初是在 app.module.ts 中导入的,并且该包是通过 npm 安装的。
我正在使用 Angular 8.2.1
我导入的库是:0.0.10 作为我相信的最新版本。
我在 Github 上尝试了很多其他人建议的不同方式,但它与这个特定的包无关,虽然编译错误类似:Unexpected value... Please add a @NgModule annotation。
这是我的 app.module.ts:
同样,该模块最初是在此处导入的,但我正在探索不同的解决方案,因此您会在我的 flight-management.module.ts 中看到重复导入,但这应该不是问题,因为我已经通过删除从 app.module 导入。
... other imports omitted
import { NgxMuiDatatablesModule } from 'ngx-mui-datatables';
@NgModule( {
declarations: [
AppComponent,
HeaderComponent,
SidenavComponent,
WelcomeComponent,
LoginDialog,
ResetPasswordComponent,
AircraftRegisterComponent,
AircraftFleetComponent,
// FlightManagementComponent,
// RouteManagementComponent,
FlightRegisterComponent,
FlightChangeDialog,
ConfirmDialog,
Error401Component,
Error404Component,
InputNumberOnlyDirective
],
imports: [
BrowserModule,
BrowserAnimationsModule,
CustomStyleModule,
RouterModule,
AppRoutingModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
FlightManagementModule,
RouteManagementModule,
NgxMuiDatatablesModule
],
// schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
providers: [],
bootstrap: [ AppComponent ],
entryComponents: [ LoginDialog, FlightChangeDialog, ConfirmDialog ]
} )
export class AppModule {}
<div class="container">
<div class="ngx-datatable-container" fxLayout="column" fxLayoutAlign="center center">
<ngx-mui-datatable title="Flight List" [data]="dataSource" [columns]="columns"
[options]="options"></ngx-mui-datatable>
</div>
</div>
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FlightManagementComponent } from './flight-management.component';
import { MuiDatatablesComponent } from 'ngx-mui-datatables/ngx-mui-datatables';
@NgModule( {
declarations: [ FlightManagementComponent, MuiDatatablesComponent ],
exports: [ FlightManagementComponent ],
imports: [ CommonModule ],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
} )
export class FlightManagementModule {}
最佳答案
您应该导入 NgxMuiDatatablesModule
在 FlightManagementModule
并删除 MuiDatatablesComponent
的声明.
它在开发环境中运行良好,因为您使用了 schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
在模块中。
删除它时,开发环境也应该有错误。
关于angular - NgxMuiDatatables 无法使用 --aot 编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57847181/
我正在尝试从 Unity 发布到我的 iPhone 4s。构建成功,但我继续收到此消息: “在 aot-only 模式下运行时无法加载 AOT 模块‘Assembly-CSharp’,因为依赖项无法找
在听说了这么多有关 Angular AOT 模式的信息后,我想尝试一下。因此,我们将应用程序迁移到 Angular v4.1.2,并进行了所有必要的更改。当我尝试使用我的 webpack 配置文件中的
我有一个 C# 项目,我需要将其编译为 native 二进制文件。我在这里读过: http://www.mono-project.com/AOT Mono 可以将程序集预编译为两个选项之一: --ao
我搜索了很多关于这种伟大语言的信息,并在此页面上找到了自己 https://github.com/dart-lang/sdk/wiki/Snapshots但它没有回答一些问题: 快照和 AOT 有什么
我知道什么是字节码检测。它只是在运行时更改 .class 文件字节码,这似乎从 JDK 1.5 开始可用。但是,据说是在类加载期间而不是运行时。 现在我的问题是,什么是 AOT 或提前检测?相反的程序
我正在为我的应用程序构建一个插件系统。我读到任何人都可以反编译 .class 文件,因此我不得不使用 Ahead-Of-Time 编译器(对吗?)。问题是我需要动态加载一些插件类。现在,我正在将所有
我的问题是 Angular 模块之一无法在 Safari 浏览器中正常工作。 我有以下代码: @NgModule({ bootstrap: [ AppComponent ], impo
我在这里问是因为我无法在网上找到完整的文档。示例 here太简单了。我有一个包含多个组件和一些模块的应用程序。用ngc编译后,我有很多错误。我发现修复它们的方法是使用相对路径。因此,我在所有组件中都使
在使用 webpack 进行 AOT 构建后,bundle 将每个组件模板包含两次,使得 bundle 比需要的大得多,因为模板作为字符串包含在内,UglifyJS 无法缩小。 我希望组件模板被排除为
我正在尝试使用 ngc 编译 angular 2.4.4: Error: Error encountered resolving symbol values statically. Expressio
当我这样做时,有什么原因(我可以解决): ngc -p tsconfig.aot.json 作为回应,它要求: 姓名: ngc 似乎忽略了我的 tsconfig.aot.json。 这可能是什么原因?
我正在开发一个 Angular 7 应用程序,除了加载问题外它工作正常,在研究中我发现我应该使用 AOT 构建而不是 JIT 或正常构建,由于应用程序规模巨大,我无法进行 aot 构建,它正在返回堆我
我在 Dynamics AX 2012 中有一个 AOT 查询,它由 HcmWorker 和 HcmEmployment 表(等等)组成。我的问题是,当我创建报告(不是 SSRS)或以其他方式使用此查
有谁知道在使用带有 AOT 编译的 Angular CLI 时如何获得更详细的错误堆栈跟踪?使用 JIT 编译运行时,我的应用程序没有问题,但是当我运行 ng build --aot 时,我得到的只是
我想查询 AOT 以查看是否存在使用 X++ 的表名。谁能指出我正确的方向或提供一些示例代码来做到这一点? 如果表存在并提供名称 (str tableName),则返回 true;否则,返回false
我有一个 Angular 5 应用程序,当我在测试模式下运行时没有问题,也就是说,当我使用 ng serve 命令在本地运行应用程序时。但是,当我在生产模式下部署应用程序时,即通过命令ng build
语境 我正在创建一个 Angular 应用程序的桌面版本,为此我正在使用 Electron 。 打开主窗口非常简单: win = new BrowserWindow({ width: 1280
我有一个看起来像这样的错误处理程序: @Injectable() export class GlobalErrorHandler implements ErrorHandler { construct
当我尝试构建启用了 AOT 选项的 Android 应用程序时,收到以下错误消息。 Invalid command line switch for "aapt.exe". VersionCode is
我在我的 Angular 2 应用程序中使用 Highcharts 和 Kendo Charts,当我尝试运行 AOT 编译时,它会抛出类似的错误 Cannot Import Module 或 Hom
我是一名优秀的程序员,十分优秀!