http无法返回4中的html内容
我正在使用angular4,试图将html模板加载到页面中http无法返回4中的html内容,html,angular,Html,Angular,我正在使用angular4,试图将html模板加载到页面中 this.http.get("/assets/abc.html") .subscribe( (data) => { console.log("--------------"+data); } ); http的结果不是返回html内容,而是只返回如下所示的页面路径 --------------Response with status: 200 OK for URL: http://localho
this.http.get("/assets/abc.html")
.subscribe(
(data) => {
console.log("--------------"+data);
}
);
http的结果不是返回html内容,而是只返回如下所示的页面路径
--------------Response with status: 200 OK for URL: http://localhost:4200/assets/abc2.html
如何获得真正的内容 使用以下内容提取响应的内容:
this.http.get("/assets/abc.html")
.subscribe( res => {
console.log(res.text());
}
);
使用以下命令提取响应的内容:
this.http.get("/assets/abc.html")
.subscribe( res => {
console.log(res.text());
}
);
在订阅中得到的是响应对象。要获取实际数据,请尝试以下操作:
this.http.get("/assets/abc.html")
.subscribe(
(response) => {
console.log(response.text());
}
);
在订阅中得到的是响应对象。要获取实际数据,请尝试以下操作:
this.http.get("/assets/abc.html")
.subscribe(
(response) => {
console.log(response.text());
}
);
啊,同一时间同一个答案*击掌*让我们互相投票:)谢谢老兄,这里也一样啊,同一时间同一个答案*击掌*让我们互相投票:)谢谢老兄,这里也一样