【问题标题】:Unexpected value 'PdfmakeModule' imported by the module 'AppModule'模块“AppModule”导入的意外值“PdfmakeModule”
【发布时间】:2018-03-09 15:47:35
【问题描述】:

我正在尝试在我的 Angular 应用程序中使用 ng-pdf-make。以下是我的app.module.ts 文件

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { PdfmakeModule } from 'ng-pdf-make';

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

一旦我将ng-pdf-make 导入到我的模块中,控制台就会出现以下错误

Uncaught Error: Unexpected value 'PdfmakeModule' imported by the module 'AppModule'. Please add a @NgModule annotation.

ng-pdf-make版本0.0.2

【问题讨论】:

    标签: angular node-modules


    【解决方案1】:

    不包含完整模块,只需将服务 PdfmakeService 添加到提供程序并添加

    从'ng-pdf-make/pdfmake/pdfmake.service'导入{PdfmakeService};

    到组件。

    【讨论】:

      猜你喜欢
      • 2017-01-16
      • 2018-06-24
      • 1970-01-01
      • 1970-01-01
      • 2018-10-10
      • 1970-01-01
      • 2019-09-12
      • 1970-01-01
      • 2018-01-10
      相关资源
      最近更新 更多