【发布时间】:2018-08-24 04:09:27
【问题描述】:
我在 VS Code 中安装了以下扩展: https://code.visualstudio.com/blogs/2016/02/23/introducing-chrome-debugger-for-vs-code
调试器可以工作,但是我无法在 Promise 回调中设置断点。例如:
getCatWishesFromBackend() : Promise<string[]> {
return this.http.get("http://localhost:3000/api/values").toPromise()
.then(response => response.json().wishes as string[]);
}
我想在代码的那部分设置一个断点,即 then() 部分的内容。
我该怎么做?如果我在 then() 行中设置断点,它只会在调用 this.http.get() 时停止程序。调用回调时,不会考虑断点。
【问题讨论】:
标签: angular promise visual-studio-code angular-promise