Mercurial > hg > ng2-query-ismi
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 |
rev | line source |
---|---|
45 | 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 | 6 <td style="vertical-align: top;" |
45 | 7 *ngIf="rowType=='node'" *ngFor="let col of columns"> |
21 | 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 } |