annotate app/query-result-row.component.ts @ 21:930fe7460f6b

result table shows all attributes now.
author casties
date Fri, 22 Jan 2016 20:33:26 +0100
parents 98b435bb6c0c
children dc4f0541f04d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
1 import {Component} from 'angular2/core';
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
2
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
3 @Component({
13
98b435bb6c0c more query work.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
4 selector: 'tr.resultRow',
7
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
5 template: `
21
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
6 <td style="vertical-align: top;"
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
7 *ngIf="rowType=='node'" *ngFor="#col of columns">
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
8 <a *ngIf="col && col.name=='link'" href="{{rowData[col.name]}}" target="_blank">Link</a>
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
9 <span *ngIf="col && col.name!='link'">{{rowData[col.name]}}</span>
13
98b435bb6c0c more query work.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
10 </td>
21
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
11
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
12 <td style="vertical-align: top;"
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
13 *ngIf="rowType=='text'">{{rowData}}</td>
7
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
14 `,
21
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
15 inputs: ['rowData', 'rowType', 'columns']
7
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
16 })
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
17
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
18 export class QueryResultRowComponent {
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
19
21
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
20 public rowType: string;
7
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
21 public rowData: any;
21
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
22 public columns: any[];
7
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
23
21
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
24 /* ngOnInit() {
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
25 console.debug("row init! columns=", this.columns, " rowData=", this.rowData);
930fe7460f6b result table shows all attributes now.
casties
parents: 13
diff changeset
26 } */
7
6cd6c09032aa object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
27 }