view 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 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' && 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"
                [columns]="queryState.resultColumns">
            </tr>
          </table>
        </div>
        `,
    directives: [QueryResultRowComponent],
    inputs: ['queryState']
})
   
export class QueryResultComponent { 
    
    public queryState: QueryState;
        
}