0
I have the following problem, always time to deal with the result of the request http
in the subscribe
points out errors saying the property x does not exist in result
return this.http.get('url').subscribe(result => {
if (result.error) { // faça alguma coisa };
});
but in fact there is property error
but she won’t show up until I make the requisition! but I did not understand the logic of this error, and every time having compiled the error project, then I need to comment the lines of all functions that make operation with the result
, compile the program, it works, I remove the comment it continues working normal, I do not know if it is angular bug or I am doing something wrong, how to escape from this problem? I don’t know if it’s because of the visual studio code that has such directives: // tslint:disable-next-line:component-class-suffix
that removes error marks etc, anyway, any idea?
You must type the answer, or assign the result to a type any variable before accessing the property
– edson alves