בתאריך יום שלישי, 21 במאי 2019 בשעה 14:04:11 UTC+3, מאת Kfir Tevet: > > > > בתאריך יום שני, 20 במאי 2019 בשעה 19:45:59 UTC+3, מאת Kfir Tevet: >> >> I manage to get this Jsons >> --------------STREAM_DELIMITER >> Content-Type:application/json >> >> {"clientID": "asusD6", "packageID": 1, "httpStartTs": >> "asusD6_1558368943.0830119", "recordStartTs": "asusD6_1557753277"} >> --------------STREAM_DELIMITER >> Content-Type:application/json >> >> {"STAUTS": "EOF"} >> I want to take only the first json >> How I skipped over the others? >> > > > > > > this is in my angular serves > downloadFile():Observable<Pcm[]> { > let headers: HttpHeaders = new HttpHeaders() > .set('SENSOR_ID', 'asusD6') > .set('startDate', '20190513140000') > .set('endDate', '20190513140011') > .set('debugLevel', '1') > .set('Cycle', '10') > .set('Multipart', '1') > .set('Audio', '1') > .set('Accept', 'application/json') > .set('Content-Type', 'application/json'); > return this.http.get<Pcm[]>(this.ROOT_URL + '/pcm_json',{headers, > responseType:'json'}) > } > > > a > and this is in my component.ts >
ondownloadFile(){ this.dataService.downloadFile().subscribe(result => { result.forEach(r=>this.pcm.push(r)); console.log("my result is: ",this.pcm); //const EXT = fileName.substr(fileName.lastIndexOf('.') + 1); // saveAs(new Blob([], {type: MIME_TYPES[EXT]}), result); }); -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/ef426bfa-a629-4430-9108-2265ab30ccad%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.