Mercurial > hg > ng2-query-ismi
comparison src/app/query-app.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 | 308c96f734c8 |
| children | d7c947909ab8 |
comparison
equal
deleted
inserted
replaced
| 55:308c96f734c8 | 56:b22e52a128a8 |
|---|---|
| 39 console.debug("QueryAppComponent constructor!"); | 39 console.debug("QueryAppComponent constructor!"); |
| 40 let newState = this.getStateStringFromFragment(); | 40 let newState = this.getStateStringFromFragment(); |
| 41 this._queryService.setup(newState); | 41 this._queryService.setup(newState); |
| 42 this.queryStepList = []; | 42 this.queryStepList = []; |
| 43 if (this._queryService.state.getNumSteps() > 0) { | 43 if (this._queryService.state.getNumSteps() > 0) { |
| 44 // use state from URL | |
| 44 this._queryService.state.steps | 45 this._queryService.state.steps |
| 45 .forEach((elem) => this.queryStepList.push('param')); | 46 .forEach((elem) => this.queryStepList.push('param')); |
| 47 } else { | |
| 48 // new empty state | |
| 49 this.addQueryStep(); | |
| 46 } | 50 } |
| 47 this.addQueryStep(); | |
| 48 } | 51 } |
| 49 | 52 |
| 50 getStateStringFromFragment(): string { | 53 getStateStringFromFragment(): string { |
| 51 let hash: string = window.location.hash; | 54 let hash: string = window.location.hash; |
| 52 if (hash) { | 55 if (hash) { |
| 53 let frag: string = hash.substr(1); | 56 let frag: string = hash.substr(1); |
| 57 frag = decodeURIComponent(frag); | |
| 54 // base64 decode | 58 // base64 decode |
| 55 return frag; | 59 return frag; |
| 56 } | 60 } |
| 57 return null; | 61 return null; |
| 58 } | 62 } |
