Mercurial > hg > ng2-query-ismi
diff src/app/query-select.component.ts @ 56:b22e52a128a8 ng2-table
query from url fragment works now somewhat (only for id_is).
author | casties |
---|---|
date | Tue, 28 Mar 2017 20:03:36 +0200 |
parents | f8d6f8479e77 |
children | d7c947909ab8 |
line wrap: on
line diff
--- a/src/app/query-select.component.ts Mon Mar 27 14:17:55 2017 +0200 +++ b/src/app/query-select.component.ts Tue Mar 28 20:03:36 2017 +0200 @@ -17,7 +17,8 @@ <form (ngSubmit)="onSubmit()"> <select name="mode" (change)="onSelectMode($event)"> <option></option> - <option *ngFor="let mode of getQueryModes()" [value]="mode.id"> + <option *ngFor="let mode of getQueryModes()" + [selected]="mode.id==selectedMode?.id" [value]="mode.id"> {{mode.label}} </option> </select> @@ -98,8 +99,12 @@ setup() { console.log("query-select setup step=", this.queryStep); - var step = this._queryService.state.steps[this.index-1]; + var step = this._queryService.state.steps[this.index]; // i-1? if (step != null) { + this.selectedMode = step.mode; + if (step.mode.id === 'id_is') { + this.queryInput = step.params.value; + } this.resultInfo = step.resultInfo; } }