mariuszfoltak / angular2-datatable

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

Add systemjs configuration example to readme file #18

Open ghost opened 8 years ago

ghost commented 8 years ago

errir

dinagr commented 8 years ago

I am having the same problems. Did you find a solution?

mariuszfoltak commented 8 years ago

If you use systemjs, you should add configuration

System.config({
  packages: [
    'angular2-datatable': { defaultExtension: 'js' },
    ...
  ]
});

You can check this file: https://github.com/mariuszfoltak/angular2-datatable/blob/master/examples/systemjs/systemjs.conf.js

dinagr commented 8 years ago

Thanks for your quick reply! Now I get this error - zone.js:101 GET http://localhost:3000/angular2-datatable/datatable.js 404 (Not Found)

mariuszfoltak commented 8 years ago

You must add also configuration for mapping:

System.config({
  map: {
    'angular2-datatable': 'node_modules/angular2-datatable',
  },
  packages: {
    'angular2-datatable': { defaultExtension: 'js' },
    ...
  }
});
dinagr commented 8 years ago

and for this? zone.js:101 GET http://localhost:3000/lodash 404 (Not Found)

mariuszfoltak commented 8 years ago
System.config({
  map: {
    'lodash': 'node_modules/lodash/lodash.js',
    ...
  },
  packages: {
    'lodash':                     { defaultExtension: 'js' },
    ...
  }
});
dinagr commented 8 years ago

Thanks a lot!!! It is working now only the pagination is not working I added this -

<tfoot>
     <tr>
         <td colspan="4">
              <mfBootstrapPaginator [rowsOnPageSet]="[5,10,25]"></mfBootstrapPaginator>
         </td>
    </tr>
</tfoot>

between the and the tags but the pagination is not showing What else do I need to do?

mariuszfoltak commented 8 years ago

mfBootstrapPaginator is displayed only when data length is greather than min rowsOnPage value. Look at this example files: https://github.com/mariuszfoltak/angular2-datatable/tree/master/examples/systemjs/src

kvbhaskar7 commented 7 years ago

Hi,

I am new to angular and just setup my new angular2 application. I just setup angular2-datatable to my component and doesn't seems to be working. Not sure whats wrong here. Any help is really appreciated as i m really stuck and not able to proceed further.

When i comment out DataTableModule in app.module.ts, my app is working as expected with my features.

Error in my App loading: Error: (SystemJS) Unexpected value 'undefined' imported by the module 'AppModule' Error: Unexpected value 'undefined' imported by the module 'AppModule' at eval (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:14680:29) [] at Array.forEach (native) [] at CompileMetadataResolver._loadNgModuleMetadata (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:14660:51) [] at CompileMetadataResolver.loadNgModuleMetadata (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:14625:31) [] at RuntimeCompiler._loadModules (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:17420:43) [] at RuntimeCompiler._compileModuleAndComponents (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:17390:37) [] at RuntimeCompiler.compileModuleAsync (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:17380:23) [] at PlatformRef_._bootstrapModuleWithZone (http://localhost:3276/node_modules/@angular/core/bundles/core.umd.js:6454:29) [] at PlatformRef_.bootstrapModule (http://localhost:3276/node_modules/@angular/core/bundles/core.umd.js:6436:25) [] at Object.eval (http://localhost:3276/app/main.js:7:10) [] at eval (http://localhost:3276/app/main.js:10:4) [] at eval (http://localhost:3276/app/main.js:11:3) [] at eval () [] Evaluating http://localhost:3276/app/main.js Error loading http://localhost:3276/app/main.js at eval (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:14680:29) [] at Array.forEach (native) [] at CompileMetadataResolver._loadNgModuleMetadata (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:14660:51) [] at CompileMetadataResolver.loadNgModuleMetadata (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:14625:31) [] at RuntimeCompiler._loadModules (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:17420:43) [] at RuntimeCompiler._compileModuleAndComponents (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:17390:37) [] at RuntimeCompiler.compileModuleAsync (http://localhost:3276/node_modules/@angular/compiler/bundles/compiler.umd.js:17380:23) [] at PlatformRef_._bootstrapModuleWithZone (http://localhost:3276/node_modules/@angular/core/bundles/core.umd.js:6454:29) [] at PlatformRef_.bootstrapModule (http://localhost:3276/node_modules/@angular/core/bundles/core.umd.js:6436:25) [] at Object.eval (http://localhost:3276/app/main.js:7:10) [] at eval (http://localhost:3276/app/main.js:10:4) [] at eval (http://localhost:3276/app/main.js:11:3) [] at eval () [] Evaluating http://localhost:3276/app/main.js Error loading http://localhost:3276/app/main.js

app.module.ts

  1. Added import { DataTableModule } from "angular2-datatable";
  2. Imported @NgModule({ imports: [
    DataTableModule, ]

systemjs.config.js file /**

package.json "angular2-datatable": "^0.6.0", "lodash": "^4.17.2",

When i try to load my app, its failing with the error i mentioned above. Can someone please help !