Mercurial > hg > ng2-query-ismi
view app/query-result.component.ts @ 31:4926885f8a99
selectable result columns. nicer cypher query output.
author | casties |
---|---|
date | Mon, 01 Feb 2016 20:10:55 +0100 |
parents | c2946b7135cd |
children | dc4f0541f04d |
line wrap: on
line source
import {Component, OnInit} from 'angular2/core'; import {QueryState} from './query-state'; import {QueryResultRowComponent} from './query-result-row.component'; @Component({ selector: 'query-result', template: ` <div *ngIf="queryState"> <span>Cypher query:</span> <pre>{{queryState.resultCypherQuery}}</pre> <p>Query results ({{queryState.resultInfo}}):</p> <table> <tr> <th *ngIf="queryState.resultTypes=='node' && queryState.resultColumns" *ngFor="#col of queryState.resultColumns">{{col?col.title:col}}</th> </tr> <tr class="resultRow" *ngFor="#row of queryState.results" [rowData]="row" [rowType]="queryState.resultTypes" [columns]="queryState.resultColumns"> </tr> </table> </div> `, directives: [QueryResultRowComponent], inputs: ['queryState'] }) export class QueryResultComponent { public queryState: QueryState; }