Let's say I have the typed object:
x: Endereco
public interface Endereco {
rua: string;
numero: number;
}
And I have a GET http that will feed this variable x. The problem is that in the request I get a json with the "neighborhood" parameter that I do not want to go to my x variable. How do I 'filter' this?
{
rua: "nome da rua",
numero: 34,
bairro: "Não quero isso"
}
I currently do this:
http.get<Endereco>('url')
.subscribe(resposta => this.x = resposta)
Here the variable X becomes an object with the neighborhood parameter, and I do not want that to happen.