【发布时间】:2020-03-01 02:15:10
【问题描述】:
我正在开发一个 Angular 的应用程序。
我有这个问题。我放了一个debugger;,因为我想在source 选项卡的watch 部分中查看返回属性this.facturas 的内容。但是,在运行应用程序并让它停在我想要的地方之后,当查看watch 时,我只得到undefined 的this.facturas,但问题是它实际上有一个值:它是一个对象数组在我的 .html 模板的表格中填充行的 td's。
.ts 代码:
this.documentosService.getFacturas(this.requestCuatro).subscribe((data: any) => {
if (data) {
if (data.documentos.length == 0 && data.error.codError == 0) {
swal("Stop! Trolls and Dragons found!");
} else {
this.facturas = data.documentos;
debugger;
}
if (data.error.codError != 0) {
swal("Warning! Sorry, the old Monarc Elf died :(");
}
}
});
我希望能够查看我从服务器返回的值,但我不确定如何。我在看this.facturas,但我没有定义,所以我编码有点像我的眼睛被遮住了。
有什么帮助吗?谢谢。
【问题讨论】:
-
刚开始的时候也有同样的问题。 stackoverflow.com/questions/54026858/…
标签: angular debugging google-chrome-devtools