Mercurial > hg > ng2-query-ismi
comparison src/app/query-result.component.ts @ 47:b65a031c4967 ng2-final
first step to angular2-final (2.4) version of the query browser.
author | casties |
---|---|
date | Fri, 17 Mar 2017 20:16:52 +0100 |
parents | app/query-result.component.ts@dc4f0541f04d |
children | f8d6f8479e77 |
comparison
equal
deleted
inserted
replaced
46:1f3fed01aef6 | 47:b65a031c4967 |
---|---|
1 import {Component, OnInit} from '@angular/core'; | |
2 | |
3 import {QueryState} from './query-state'; | |
4 | |
5 import {QueryResultRowComponent} from './query-result-row.component'; | |
6 | |
7 @Component({ | |
8 selector: 'query-result', | |
9 template: ` | |
10 <div *ngIf="queryState"> | |
11 <span>Cypher query:</span> | |
12 <pre>{{queryState.resultCypherQuery}}</pre> | |
13 <p>Query results ({{queryState.resultInfo}}):</p> | |
14 <table> | |
15 <tr> | |
16 <th *ngIf="queryState.resultTypes=='node' && queryState.resultColumns" | |
17 *ngFor="let col of queryState.resultColumns">{{col?col.title:col}}</th> | |
18 </tr> | |
19 <tr class="resultRow" *ngFor="let row of queryState.results" | |
20 [rowData]="row" [rowType]="queryState.resultTypes" | |
21 [columns]="queryState.resultColumns"> | |
22 </tr> | |
23 </table> | |
24 </div> | |
25 `, | |
26 //directives: [QueryResultRowComponent], | |
27 inputs: ['queryState', 'resultInfo'] | |
28 }) | |
29 | |
30 export class QueryResultComponent { | |
31 | |
32 public queryState: QueryState; | |
33 public resultInfo: string; | |
34 | |
35 } |