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",
"peerDependencies": {
"@angular/common": "^6.0.0-rc.0 || ^6.0.0",

View File

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

View File

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

View File

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