Formatting

This commit is contained in:
Zakary Timson 2018-06-08 12:47:47 -04:00
parent 2f34aedce5
commit 51f1967fb2
4 changed files with 19 additions and 28 deletions

View File

@ -1,5 +1,5 @@
{ {
"name": "ng-datatable", "name": "@ztimson/ng-datatable",
"version": "1.0.0", "version": "1.0.0",
"peerDependencies": { "peerDependencies": {
"@angular/common": "^6.0.0-rc.0 || ^6.0.0", "@angular/common": "^6.0.0-rc.0 || ^6.0.0",

View File

@ -1,14 +1,10 @@
import {NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import {FormsModule} from "@angular/forms"; import {FormsModule} from '@angular/forms';
import {BrowserModule} from "@angular/platform-browser"; import {BrowserModule} from '@angular/platform-browser';
import {NgDatatableComponent} from './ng-datatable.component'; import {NgDatatableComponent} from './ng-datatable.component';
@NgModule({ @NgModule({
imports: [ imports: [BrowserModule, FormsModule],
BrowserModule,
FormsModule,
],
declarations: [NgDatatableComponent], declarations: [NgDatatableComponent],
exports: [NgDatatableComponent] exports: [NgDatatableComponent]
}) })

View File

@ -1,3 +1,3 @@
export * from './lib/column' export * from './lib/column'
export * from './lib/ng-dataTable.component'; export * from './lib/ng-datatable.component';
export * from './lib/ng-dataTable.module'; export * from './lib/ng-datatable.module';

View File

@ -1,24 +1,19 @@
Table CSS <input [(ngModel)]="tableCSS"> Table CSS
Selection Mode <select [(ngModel)]="selectionMode"> <input [(ngModel)]="tableCSS"> Selection Mode
<select [(ngModel)]="selectionMode">
<option>None</option> <option>None</option>
<option>single</option> <option>single</option>
<option>multi</option> <option>multi</option>
</select> </select>
Checkbox <input type="checkbox" [(ngModel)]="checkbox"> Checkbox
Expandable <input type="checkbox" [(ngModel)]="expandable"> <input type="checkbox" [(ngModel)]="checkbox"> Expandable
<br><br> <input type="checkbox" [(ngModel)]="expandable">
<input placeholder="Search" (keyup)="search.next($event.target.value)">
<br> <br>
Selected: {{table.selectedRows.size}}/{{table.processedData.length}} <br>
<ng-datatable #table <input placeholder="Search" (keyup)="search.next($event.target.value)">
[cssClass]="tableCSS" <br> Selected: {{table.selectedRows.size}}/{{table.processedData.length}}
[columns]="columns" <ng-datatable #table [cssClass]="tableCSS" [columns]="columns" [data]="data" [expandedTemplate]="expandable ? expanded : null"
[data]="data" [showCheckbox]="checkbox" [paginate]="false" [selectionMode]="selectionMode == 'None' ? null : selectionMode" (rowSelected)="log($event)">
[expandedTemplate]="expandable ? expanded : null"
[showCheckbox]="checkbox"
[paginate]="false"
[selectionMode]="selectionMode == 'None' ? null : selectionMode"
(rowSelected)="log($event)">
<ng-template #expanded let-object="object"> <ng-template #expanded let-object="object">
Hello {{object.firstName}} {{object.lastName}}, How are you today? Hello {{object.firstName}} {{object.lastName}}, How are you today?
<span *ngIf="object.age < 18">I can see that you are under age.</span> <span *ngIf="object.age < 18">I can see that you are under age.</span>