我正在向后端订阅,这给了我iframe(html)形式的响应。我只需要在我的html组件上呈现它。我该怎么办?当我控制台记录响应(iframe html响应)。我认为这是一个错误。我想念什么?
app.component.ts
export class AppComponent implements OnInit {
constructor(private hpcService: HPCService) { }
title = 'rohit-pbcc';
iFrame = '';
ngOnInit() {
this.hpcService.getHPCIFrame().subscribe(response => {
this.iFrame = response;
console.log(String(this.iFrame));
});
}
}
service.ts
export class HPCService {
constructor(private http: HttpClient) { }
getHPCIFrame(): Observable<any> {
const url = 'https://xxxxxx/xxx/xxxx/xxxxxx/xxxx';
const request = HPCInitREquest;
console.log(request);
return this.http
.post(url, request)
.pipe(map((response) => {
return response;
}));
}
}
此语句是控制台记录错误:
console.log(String(this.iFrame));