annotate src/app/query-result-row.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-row.component.ts@dc4f0541f04d
children f8d6f8479e77
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45
dc4f0541f04d update to angular2-rc1. mostly working ;-(
casties
parents: 21
diff changeset
1 import {Component} from '@angular/core';
7
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;"
45
dc4f0541f04d update to angular2-rc1. mostly working ;-(
casties
parents: 21
diff changeset
7 *ngIf="rowType=='node'" *ngFor="let col of columns">
21
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 }