Mercurial > hg > ng2-query-ismi
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/app/query-result-row.component.ts Mon Mar 20 18:50:31 2017 +0100 @@ -0,0 +1,29 @@ +import {Component} from '@angular/core'; + +@Component({ + selector: 'tr.resultRow', + template: ` + <ng-container *ngIf="rowType=='node'"> + <td style="vertical-align: top;" + *ngFor="let col of columns"> + <a *ngIf="col && col.name=='link'" href="{{rowData[col.name]}}" target="_blank">Link</a> + <span *ngIf="col && col.name!='link'">{{rowData[col.name]}}</span> + </td> + </ng-container> + <ng-container *ngIf="rowType=='text'"> + <td style="vertical-align: top;">{{rowData}}</td> + </ng-container> + `, + inputs: ['rowData', 'rowType', 'columns'] +}) + +export class QueryResultRowComponent { + + public rowType: string; + public rowData: any; + public columns: any[]; + + ngOnInit() { + console.debug("row init! rowType=", this.rowType, " columns=", this.columns, " rowData=", this.rowData); + } +}