data is this JSON object? You can’t use split() on an object, only on strings. You have to iterate over your object and apply the function to your values.
You need to provide some more information for us to be able to help you further - we have no idea what you’re trying to achieve exactly. What does your HTML look like?
Also, if this is how you indent your code in your project, I would really recommend doing it like this:
getDataEtalon() {
return this.data.getEtalon().subscribe(
data => {
for (let key in data) {
this.etalon = data[key].split('##');
}
console.log(this.etalon);
}
);
}
It really improves readability. Also, if this is an HTTP call you probably want to handle potential errors
getDataEtalon() {
return this.data.getEtalon().subscribe(
data => {
for (let key in data) {
this.etalon = data[key].split('##');
}
console.log(this.etalon);
},
err => {
console.log(err);
}
);
}