Mercurial > hg > ng2-query-ismi
diff app/query-result.component.ts @ 21:930fe7460f6b
result table shows all attributes now.
author | casties |
---|---|
date | Fri, 22 Jan 2016 20:33:26 +0100 |
parents | 98b435bb6c0c |
children | f6f4177d0a81 |
line wrap: on
line diff
--- a/app/query-result.component.ts Fri Jan 22 17:32:33 2016 +0100 +++ b/app/query-result.component.ts Fri Jan 22 20:33:26 2016 +0100 @@ -12,12 +12,12 @@ <p>Query results ({{queryState.resultInfo}}):</p> <table> <tr> - <th *ngIf="queryState.resultTypes=='node'">ID</th> - <th *ngIf="queryState.resultTypes=='node'">Label</th> - <th *ngIf="queryState.resultTypes=='node'">Link</th> + <th *ngIf="queryState.resultTypes=='node' && queryState.resultColumns" + *ngFor="#col of queryState.resultColumns">{{col?col.label:col}}</th> </tr> <tr class="resultRow" *ngFor="#row of queryState.results" - [rowData]="row" [rowType]="queryState.resultTypes"> + [rowData]="row" [rowType]="queryState.resultTypes" + [columns]="queryState.resultColumns"> </tr> </table> </div> @@ -26,20 +26,8 @@ inputs: ['queryState'] }) -export class QueryResultComponent implements OnInit { +export class QueryResultComponent { public queryState: QueryState; - - ngOnChanges() { - console.debug("result changed!"); - } - - ngOnInit() { - this.setup(); - } - - setup() { - console.debug("result init!"); - } - + }