When I call the GetServiceProviderId() function in my code, I am making a GET request to an API and expecting the result as a string that can be split.
GetServiceProviderId() {
this.http.get(this.rooturl + 'info', { headers: this.reqHeader });
var data = "mitId: 18, ServiceProvider: 2" <- this is the result received from the API
var dataspilitted = data.split(" ");
return dataspilitted[3];
}