Mercurial > hg > ng2-query-ismi
view app/query-result.component.ts @ 11:6989cd00e8d7
relations work now as well as longer queries.
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 20 Jan 2016 19:49:10 +0100 |
parents | 402c7229dc7c |
children | 1843b12eff9a |
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"> <pre>{{queryState.resultCypherQuery}}</pre> <p>Query results ({{queryState.resultInfo}}):</p> <table> <tr> <th *ngIf="queryState.resultTypes=='node'">Type</th> <th *ngIf="queryState.resultTypes=='node'">Label</th> </tr> <tr *ngFor="#row of queryState.results"> <query-result-row [rowData]="row" [rowType]="queryState.resultTypes"></query-result-row> </tr> </table> </div> `, directives: [QueryResultRowComponent], inputs: ['queryState'] }) export class QueryResultComponent implements OnInit { public queryState: QueryState; ngOnChanges() { console.debug("result changed!"); } ngOnInit() { this.setup(); } setup() { console.debug("result init!"); } }