view app/query-result.component.ts @ 32:4c046f3244ec

new 'id_is' query type. new '_type' attribute.
author casties
date Tue, 02 Feb 2016 19:20:44 +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;
        
}