无法绑定到dtOptions,因为它不是table的已知属性

时间:2018-11-22 02:32:52

标签: angular datatables angular-datatables ngx-admin

我要提交问题

当前行为

预期行为

尝试with-options

通过说明将问题最小化

Can't bind to 'dtOptions' since it isn't a known property of 'table'. ("
  <nb-card-body>
    <!--<table datatable class="row-border hover">-->
    <table datatable [ERROR ->][dtOptions]="dtOptions" class="row-border hover">
      <thead>
      <tr>
"): ng:///TablesModule/WithOptionsComponent.html@7:21
Can't bind to 'dtOptions' since it isn't a known property of 'table'. ("
  <nb-card-body>
    <!--<table datatable class="row-border hover">-->
    <table datatable [ERROR ->][dtOptions]="dtOptions" class="row-border hover">
      <thead>
      <tr>
"): ng:///TablesModule/WithOptionsComponent.html@7:21
Can't bind to 'dtOptions' since it isn't a known property of 'table'. ("
  <nb-card-body>
    <!--<table datatable class="row-border hover">-->
    <table datatable [ERROR ->][dtOptions]="dtOptions" class="row-border hover">
      <thead>

环境


- node version:v10.10.0
- angular version:6.0
- angular-cli version:6.0
- jquery version:3.3.1
- datatables version:1.10.19
- angular-datatables version:7.0.0

我分叉项目ngx-admin; 尝试集成角度数据表

阅读 getting started

但是有例外

project code

请帮助我 1542804819644

1 个答案:

答案 0 :(得分:0)

set app.module.ts
improt DataTablesModule.forRoot(),
set tables.module.ts
imports DataTablesModule

感谢您的帮助。问题已经解决。