Mercurial > hg > ng2-query-ismi
comparison 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 |
comparison
equal
deleted
inserted
replaced
55:308c96f734c8 | 56:b22e52a128a8 |
---|---|
15 <p *ngIf="resultInfo"> result: {{resultInfo}}</p> | 15 <p *ngIf="resultInfo"> result: {{resultInfo}}</p> |
16 <div> | 16 <div> |
17 <form (ngSubmit)="onSubmit()"> | 17 <form (ngSubmit)="onSubmit()"> |
18 <select name="mode" (change)="onSelectMode($event)"> | 18 <select name="mode" (change)="onSelectMode($event)"> |
19 <option></option> | 19 <option></option> |
20 <option *ngFor="let mode of getQueryModes()" [value]="mode.id"> | 20 <option *ngFor="let mode of getQueryModes()" |
21 [selected]="mode.id==selectedMode?.id" [value]="mode.id"> | |
21 {{mode.label}} | 22 {{mode.label}} |
22 </option> | 23 </option> |
23 </select> | 24 </select> |
24 | 25 |
25 <span *ngIf="selectedMode?.id=='type_is'"> | 26 <span *ngIf="selectedMode?.id=='type_is'"> |
96 this.setup(); | 97 this.setup(); |
97 } | 98 } |
98 | 99 |
99 setup() { | 100 setup() { |
100 console.log("query-select setup step=", this.queryStep); | 101 console.log("query-select setup step=", this.queryStep); |
101 var step = this._queryService.state.steps[this.index-1]; | 102 var step = this._queryService.state.steps[this.index]; // i-1? |
102 if (step != null) { | 103 if (step != null) { |
104 this.selectedMode = step.mode; | |
105 if (step.mode.id === 'id_is') { | |
106 this.queryInput = step.params.value; | |
107 } | |
103 this.resultInfo = step.resultInfo; | 108 this.resultInfo = step.resultInfo; |
104 } | 109 } |
105 } | 110 } |
106 | 111 |
107 getQueryModes(): QueryMode[] { | 112 getQueryModes(): QueryMode[] { |