# HG changeset patch # User casties # Date 1490272890 -3600 # Node ID 738e902384431fdeb45e721fd48d22ee7a8eda94 # Parent 1245781e2575473412624087bc93509ec9e9b8b6 ng2-table version mostly works (without page-n-of-m, problems with columns). diff -r 1245781e2575 -r 738e90238443 package.json --- a/package.json Thu Mar 23 11:04:48 2017 +0100 +++ b/package.json Thu Mar 23 13:41:30 2017 +0100 @@ -1,6 +1,6 @@ { "name": "ng2-ismi-query-app", - "version": "1.0.0", + "version": "1.1.0", "scripts": { "build": "tsc -p src/", "build:watch": "tsc -p src/ -w", diff -r 1245781e2575 -r 738e90238443 src/app/query-app.module.ts --- a/src/app/query-app.module.ts Thu Mar 23 11:04:48 2017 +0100 +++ b/src/app/query-app.module.ts Thu Mar 23 13:41:30 2017 +0100 @@ -4,7 +4,7 @@ import { HttpModule } from '@angular/http'; import { Ng2TableModule } from 'ng2-table/ng2-table'; -import { PaginationModule } from 'ng2-bootstrap/pagination'; +import { PaginationModule } from 'ng2-bootstrap'; import { QueryAppComponent } from './query-app.component'; import { QuerySelectComponent } from './query-select.component'; @@ -17,7 +17,7 @@ @NgModule({ imports: [ BrowserModule, FormsModule, HttpModule, - Ng2TableModule, PaginationModule ], + Ng2TableModule, PaginationModule.forRoot() ], declarations: [ QueryAppComponent, QuerySelectComponent, // QueryResultComponent, QueryResultRowComponent QueryResultTableComponent ], diff -r 1245781e2575 -r 738e90238443 src/app/query-result-table.component.ts --- a/src/app/query-result-table.component.ts Thu Mar 23 11:04:48 2017 +0100 +++ b/src/app/query-result-table.component.ts Thu Mar 23 13:41:30 2017 +0100 @@ -17,7 +17,7 @@
Show - @@ -28,15 +28,14 @@
Columns: - {{col.name}} + {{col.name}}
-
Page {{page}} of {{numPages}}
- Page {{currentPage}} of {{numPages}}
--> + ; - public page: number = 1; + public currentPage: number = 1; public itemsPerPage: number = 10; public maxSize: number = 5; public numPages: number = 1; @@ -87,7 +86,7 @@ this.allColumns = this.queryState.resultColumns; this.columns = this.allColumns.filter(c => c.show); this.config.sorting = this.columns; - this.config.paging = {'page': this.page, 'itemsPerPage': this.itemsPerPage}; + this.config.paging = {'page': this.currentPage, 'itemsPerPage': this.itemsPerPage}; this.showTable = (this.data.length < 1000); this.onChangeTable(this.config); } @@ -106,7 +105,7 @@ this.itemsPerPage = num; } // update something - this.config.paging = {'page': this.page, 'itemsPerPage': this.itemsPerPage}; + this.config.paging = {'page': this.currentPage, 'itemsPerPage': this.itemsPerPage}; this.onChangeTable(this.config); } @@ -163,8 +162,8 @@ Object.assign(this.config.sorting, config.sorting); // changing sorting resets page if (page == null) { - this.page = 1; - page = {'page': this.page, 'itemsPerPage': this.itemsPerPage}; + this.currentPage = 1; + page = {'page': this.currentPage, 'itemsPerPage': this.itemsPerPage}; } } diff -r 1245781e2575 -r 738e90238443 src/systemjs.config.js --- a/src/systemjs.config.js Thu Mar 23 11:04:48 2017 +0100 +++ b/src/systemjs.config.js Thu Mar 23 13:41:30 2017 +0100 @@ -37,6 +37,14 @@ }, rxjs: { defaultExtension: 'js' + }, + 'ng2-bootstrap': { + format: 'cjs', + main: 'bundles/ng2-bootstrap.umd.js', + defaultExtension: 'js' + }, + 'ng2-table': { + defaultExtension: 'js' } } });