Mercurial > hg > ng2-query-ismi
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 |
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 | 6 <td style="vertical-align: top;" |
7 *ngIf="rowType=='node'" *ngFor="#col of columns"> | |
8 <a *ngIf="col && col.name=='link'" href="{{rowData[col.name]}}" target="_blank">Link</a> | |
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 | 11 |
12 <td style="vertical-align: top;" | |
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 | 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 | 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 | 22 public columns: any[]; |
7
6cd6c09032aa
object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
23 |
21 | 24 /* ngOnInit() { |
25 console.debug("row init! columns=", this.columns, " rowData=", this.rowData); | |
26 } */ | |
7
6cd6c09032aa
object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
27 } |