0

I'm trying to get my list with my autogenerated code in backend but it wont display in the front end.

SERVER RESPONSE

here's my code for getting the object

.TS.SERVICES

getNextId(){
 return this.http.get(this.appSettings.baseURL +'Delivery/getNextSequence');

.TS COMPONENT

getNextDRId(){
   this.microSvc.getNextId().subscribe((response: string) =>{
   this.idObj = response;
 })
}

.HTML

<mat-form-field class="full-width" >
         <mat-label>Transaction #</mat-label>
         <input matInput type="text" formControlName="transactionType" readonly 
         ngModel{{idObj}} >
</mat-form-field>

enter image description here

Gert Arnold
  • 105,341
  • 31
  • 202
  • 291
Yan
  • 149
  • 1
  • 9
  • Is the backed sending you a json response? what's the output if you console.log response; inside getNextDRId?, if the response from the server 200? – Florencia Cames Jun 23 '22 at 06:24
  • No output display when I put console.log – Yan Jun 23 '22 at 06:28
  • When doing the api call, in the inspect element - network of the browser, what are you recieving? is that call resturning a Status Code: 200 response? or maybe having a CORS error, maybe trying to log the error inside the subscribe could help you see if there's any error from the api response. If you make a screenshot of the header could be useful – Florencia Cames Jun 23 '22 at 06:32
  • I've already update my post and put the server response image – Yan Jun 23 '22 at 06:38
  • 1
    Thanks! the normal http response will expect the content-type to be something like `content-type: application/json; charset=utf-8`. If your going to receive another kind of response like text you might need to add a header to the api call in this post there are multiple examples of changing the api response – Florencia Cames Jun 23 '22 at 06:46
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/245840/discussion-between-ryuuu-and-florencia-cames). – Yan Jun 23 '22 at 08:29
  • @FlorenciaCames Do you have any recommendation when you click the selection option dropdown it can be search cause now im using ngx-select-dropdown but it won't send to the databases – Yan Jun 23 '22 at 08:31
  • I left you some comments in the discussion chat – Florencia Cames Jun 23 '22 at 08:47
  • i send some picture i think mat-menu is not applicable for that @FlorenciaCames – Yan Jun 23 '22 at 09:06
  • I removed the linq tag because it's not related to the code in the question. – Gert Arnold Jun 23 '22 at 09:07

0 Answers0