Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70434

Showing data from api to html in ionic 4 and angular

$
0
0

@akshh wrote:

Api is written is c# asp.net framework to fetch single data from Database.Not sure how to call Api in Ui part.

Api written is in menu.ts is,

public GetBuilds() {
this.httpService.get("/ConfigApi/api/number”).subscribe(
response => {
console.log(response)
},
error => console.log(error)// error path
)
}

This conctructor will be called in the modal where the button click will generate a modal and data will be generated.When this runs in console it throws

HttpErrorResponse {headers: HttpHeaders, status: 200, statusText: “OK”, url: “http://localhost:8100/ConfigApi/api/number”, ok: false, …}

headers: HttpHeaders {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ}

status: 200

statusText: “OK”

url: ““http://localhost:8100/ConfigApi/api/number””

ok: false

name: “HttpErrorResponse”

message: “Http failure during parsing for http://localhost:8100/ConfigApi/api/number”

error: {error: SyntaxError: Unexpected token . in JSON at position 6 at JSON.parse () at XMLHtt…, text: “20.300.88”}

proto: HttpResponseBase
The text mentioned in bold must be displayed.

How should i rectify this error and what must be added in ts file? Can anyone please tell me…Since im new to this facing issues

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70434

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>