i am quite a beginner in angular.
I hope someone can help me.
I call a REST interface in the Angularframework with the following code.
public getAntwort(){
return this.http.get<Mail>('http://......')
.pipe(retry(3),catchError(this.handleError));
}
In the calling component, I save this in a field that is defined with any.
export class SemailUiComponent implements OnInit {
mail: any;
constructor(private semailDataService: SemailService) {
}
ngOnInit(): void {
this.mail = this.semailDataService.getAntwort();
}
}
If I output the this.mail field, I don't get a string but an object.
The remainder of the interface delivers a string.
The second problem is that I want to print the string. How do I do this in HTML '
Thank you for the answers
question from:
https://stackoverflow.com/questions/65896328/incorrect-display-in-the-browser-in-an-angular-application 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…