Mercurial > hg > ng2-query-ismi
comparison 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 |
comparison
equal
deleted
inserted
replaced
43:39edd27d83e4 | 49:781a5387ca93 |
---|---|
1 import {Component} from '@angular/core'; | |
2 | |
3 @Component({ | |
4 selector: 'tr.resultRow', | |
5 template: ` | |
6 <ng-container *ngIf="rowType=='node'"> | |
7 <td style="vertical-align: top;" | |
8 *ngFor="let col of columns"> | |
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> | |
11 </td> | |
12 </ng-container> | |
13 <ng-container *ngIf="rowType=='text'"> | |
14 <td style="vertical-align: top;">{{rowData}}</td> | |
15 </ng-container> | |
16 `, | |
17 inputs: ['rowData', 'rowType', 'columns'] | |
18 }) | |
19 | |
20 export class QueryResultRowComponent { | |
21 | |
22 public rowType: string; | |
23 public rowData: any; | |
24 public columns: any[]; | |
25 | |
26 ngOnInit() { | |
27 console.debug("row init! rowType=", this.rowType, " columns=", this.columns, " rowData=", this.rowData); | |
28 } | |
29 } |