Mercurial > hg > ng2-query-ismi
annotate src/app/query-result-row.component.ts @ 49:781a5387ca93
Merge with angular2-final branch
f8d6f8479e77011fd043c5feb2b14a476d0aaffc
author | casties |
---|---|
date | Mon, 20 Mar 2017 18:50:31 +0100 |
parents | f8d6f8479e77 |
children |
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: ` |
48
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
6 <ng-container *ngIf="rowType=='node'"> |
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
7 <td style="vertical-align: top;" |
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
8 *ngFor="let col of columns"> |
21 | 9 <a *ngIf="col && col.name=='link'" href="{{rowData[col.name]}}" target="_blank">Link</a> |
10 <span *ngIf="col && col.name!='link'">{{rowData[col.name]}}</span> | |
48
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
11 </td> |
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
12 </ng-container> |
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
13 <ng-container *ngIf="rowType=='text'"> |
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
14 <td style="vertical-align: top;">{{rowData}}</td> |
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
15 </ng-container> |
7
6cd6c09032aa
object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
16 `, |
21 | 17 inputs: ['rowData', 'rowType', 'columns'] |
7
6cd6c09032aa
object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
18 }) |
6cd6c09032aa
object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
19 |
6cd6c09032aa
object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
20 export class QueryResultRowComponent { |
6cd6c09032aa
object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
21 |
21 | 22 public rowType: string; |
7
6cd6c09032aa
object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
23 public rowData: any; |
21 | 24 public columns: any[]; |
7
6cd6c09032aa
object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
25 |
48
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
26 ngOnInit() { |
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
27 console.debug("row init! rowType=", this.rowType, " columns=", this.columns, " rowData=", this.rowData); |
f8d6f8479e77
first working version with angular 2.4 (using old table w/o pager).
casties
parents:
47
diff
changeset
|
28 } |
7
6cd6c09032aa
object type query with results!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
29 } |