Showing data from api to html in ionic 4 and angular

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

The error message is highlighting a disconnect between the data format HttpClient is expecting to get by default (JSON) and the data format your backend is generating (IDK what that is, but clearly not JSON). So you seem to have two options: either modify the backend to generate JSON, or supply custom instructions to HttpClient explaining what format you want to work with.

Thnk u.Actually the respone which i want is 20.300.88 this.This is api which i have written,

using DataAccess.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Linq;

namespace Config.Controllers
{
[Authorize]
[Route(“api/[controller]”)]
[ApiController]
public class BuildNumberApiController : ControllerBase
{

    private BmDbContext _context;
 
    public BuildNumberApiController(DbContext context)
    {
        _context = context;

    }

    // GET: /<controller>/
    [HttpGet("[action]")]
    [ActionName("buildnbr")]

    public string GetBuilds()
    {
        System.Diagnostics.Debugger.Launch();
        return _context.Version.Select(e => e.Build).SingleOrDefault();
    }
}

}

How should i proceed?

I would read the HttpClient documentation talking about non-JSON formats.