' ng2smarttableModule'似乎不是ngmodule类。(-996002)

发布于 2025-02-12 04:36:17 字数 722 浏览 2 评论 0原文

... 使用纱线后,创建一个新项目 导入有错误 (别名)ng2smarttableModule类 导入NG2SMARTTABLEMODULE “ NG2SmarttableModule”似乎不是NGMODULE类。 (-996002) ng2-smart-table.module.d.ts(1,22):这可能意味着库(ng2-smart-table)声明ng2smarttablemodule尚未通过NGCC正确处理或与Angular Ivy不兼容。检查是否可用较新的库版本,并进行更新。另外,请考虑与图书馆的作者进行检查,以查看图书馆是否与Ivy兼容。

...

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { Ng2SmartTableModule } from 'ng2-smart-table'; // add
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    Ng2SmartTableModule, // add
  ],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}

...
Create a new project after using yarn add ng2-smart-table
Have an error in imports
(alias) class Ng2SmartTableModule
import Ng2SmartTableModule
'Ng2SmartTableModule' does not appear to be a NgModule class. (-996002)
ng2-smart-table.module.d.ts(1, 22): This likely means that the library (ng2-smart-table) declares Ng2SmartTableModule has not been processed correctly by ngcc or is not compatible with Angular Ivy. Check if a newer library version 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.

...

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { Ng2SmartTableModule } from 'ng2-smart-table'; // add
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    Ng2SmartTableModule, // add
  ],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

少女情怀诗 2025-02-19 04:36:17

包装上的文档差。从我测试的情况下,该LIB似乎与Angular 9兼容 - 看到包装的最后更新是2年前,Angular每年两次发布新的专业版本。

Angular 9仍在工作: https://stackblitz.com/edit/angular-9-starter-material-material-21jfey?file=src%2fapp%2fapp%2fapp com.ponent.ts ,, src%2fapp%2fapp%2fapp fapp.module.ts

最好寻找替代方案

http://primefaces.org/primeng/table/table

=“ https://material.angular.io/components/table/examples” rel =“ nofollow noreferrer”> https://material.io/comlular.io/components/components/table/examples/examples

://ng-bootstrap.github.io/#/components/table/overview“ rel =“ nofollow noreferrer”> https://ng-bootstrap.github.io/#/components/table/table/table/overview

Poor documentation on the package. From what I tested this lib seems compatible up to Angular 9 - which makes sense seeing that last update to package was 2 years ago and Angular releases new major version twice a year.

Angular 9 still working: https://stackblitz.com/edit/angular-9-starter-material-21jfey?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.module.ts

Better look for alternatives

http://primefaces.org/primeng/table

https://material.angular.io/components/table/examples

https://ng-bootstrap.github.io/#/components/table/overview

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文