0

在我的 Angular 应用程序中安装了 ngx-datatable 组件,在安装测试时我很简单,一切都按预期发生,但是当使用 ngx-datatable-footer 元素时,我收到以下消息:

未捕获的错误:模板解析错误:'ngx-datatable-footer' 不是已知元素: 1. 如果 'ngx-datatable-footer' 是 Angular 组件,则验证它是否是此模块的一部分。2. 如果“ngx-datatable-footer”是 Web 组件,则将“CUSTOM_ELEMENTS_SCHEMA”添加到该组件的“@NgModule.schemas”以抑制 > 此消息。("

    [ERROR ->]<ngx-datatable-footer>
      <ng-template
        ngx-datatable-footer-template>

"): ng:///GeneAppModule/ProcessoFormComponent.html@567:8 at syntaxError ( http://localhost:4200/vendor.bundle.js:170688:34 ) 在 TemplateParser.webpackJsonp.../../。 ./compiler/@angular/compiler.es5.js.TemplateParser.parse ( http://localhost:4200/vendor.bundle.js:181808:19 ) 在 JitCompiler.webpackJsonp.../../../compiler /@angular/compiler.es5.js.JitCompiler._compileTemplate ( http://localhost:4200/vendor.bundle.js:195960:39 ) 在http://localhost:4200/vendor.bundle.js:195880:62 在 Set.forEach (native) at JitCompiler.webpackJsonp.../../../compiler/@angular/compiler.es5.js.JitCompiler._compileComponents ( http://localhost:4200/vendor.bundle.js: 195880:19 ) 在http://localhost:4200/vendor.bundle.js:195767:19 在 Object.then ( http://localhost:4200/vendor.bundle.js:170677:148 ) 在 JitCompiler.webpackJsonp.../.. /../compiler/@angular/compiler.es5.js.JitCompiler._compileModuleAndComponents ( http://localhost:4200/vendor.bundle.js:195766:26 ) 在 JitCompiler.webpackJsonp.../../.. /compiler/@angular/compiler.es5.js.JitCompiler.compileModuleAsync ( http://localhost:4200/vendor.bundle.js:195695:37 )


代码工作:

<ngx-datatable
  class="material"
  [rows]="rows"
  [columnMode]="'force'"
  [footerHeight]="100"
  [headerHeight]="50"
  [rowHeight]="'auto'">
  <ngx-datatable-column name="Ordem" prop="ordem" [width]="75">
    <ng-template let-column="column" ngx-datatable-header-template>
      {{column.name}}
    </ng-template>
    <ng-template let-value="value" ngx-datatable-cell-template>
      {{value}}
    </ng-template>
  </ngx-datatable-column>
</ngx-datatable>

代码不起作用:

<ngx-datatable
  class="material"
  [rows]="rows"
  [columnMode]="'force'"
  [footerHeight]="100"
  [headerHeight]="50"
  [rowHeight]="'auto'">
  <ngx-datatable-footer>
    <ng-template
      ngx-datatable-footer-template>
      <div style="padding: 5px 10px">
        TESTE
      </div>
    </ng-template>
  </ngx-datatable-footer>
</ngx-datatable>

我的 package.json 中的版本:
“@angular/core”:“^4.2.2”、
“@swimlane/ngx-datatable”:“7.2.1”、

4

0 回答 0