mariuszfoltak / angular2-datatable

DataTable - Simple table component with sorting and pagination for Angular2
202 stars 182 forks source link

I can not use your component in angular cli. #48

Closed andrewobukhov closed 8 years ago

andrewobukhov commented 8 years ago

Hello. I am trying to use this component in my angular-cli project (it use WebPack). But I could not.

My Configuration:

import {DataTableModule, DataTable} from "angular2-datatable";

@NgModule({ imports: [ BrowserModule, AppRoutingModule, Ng2BootstrapModule, ChartsModule, DataTableModule ], })

Error:

error_handler.js:47EXCEPTION: Uncaught (in promise): Error: Template parse errors: There is no directive with "exportAs" set to "mfDataTable" ("ss="panel-heading">User information

  <table class="table table-striped" [mfData]="data" [ERROR ->]#mf="mfDataTable" [mfRowsOnPage]="10">
    <thead>
    <tr>

"): ProjectsComponent@15:57 Can't bind to 'mfData' since it isn't a known property of 'table'. ("

User information
  <table class="table table-striped" [ERROR ->][mfData]="data" #mf="mfDataTable" [mfRowsOnPage]="10">
    <thead>
    <tr>

"): ProjectsComponent@15:41 Can't bind to 'mfRowsOnPage' since it isn't a known property of 'table'. (">User information

  <table class="table table-striped" [mfData]="data" #mf="mfDataTable" [ERROR ->][mfRowsOnPage]="10">
    <thead>
    <tr>

"): ProjectsComponent@15:75 'mfDefaultSorter' is not a known element:

  1. If 'mfDefaultSorter' is an Angular component, then verify that it is part of this module.
  2. If 'mfDefaultSorter' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. (" [ERROR ->]Name "): ProjectsComponent@19:12 'mfDefaultSorter' is not a known element:
  3. If 'mfDefaultSorter' is an Angular component, then verify that it is part of this module.
  4. If 'mfDefaultSorter' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. (" [ERROR ->]Email
      <th style="width: 10%">"): ProjectsComponent@22:12

Thank you. For help

Tuupertunut commented 8 years ago

Which version are you using?

andrewobukhov commented 8 years ago

angular-cli@1.0.0-beta.17 and Angular 2.1.0 and datatable 0.5.1

andrewobukhov commented 8 years ago

Sorry. It was my mistake. I'm new in Angular2. I created new module for my component (and forgot) but trying add DataTableModule to root module (app.module.ts).