[英]Aurelia dialog & Typescript async await - Cannot find name 'await'
I'm having problems using async await together with Aurelia Dialog . 我在与Aurelia Dialog一起使用异步等待时遇到问题。 Basically I want to send away a request when the dialog is closed and currently it gives me syntax error:
基本上,我想在关闭对话框时发送请求,当前它给我语法错误:
Cannot find name 'await'
找不到名称“ await”
If I move the request outside the .WhenClosed function I dont get any syntax error and I can fire away a request. 如果我将请求移到.WhenClosed函数之外,则不会收到任何语法错误,并且可以触发请求。
您传递给whenClosed
的箭头函数必须是异步的
async response => {}
Maybe you should try to use 也许您应该尝试使用
.whenClose(async (response) => { let result_2 = await this.organisationService... })
to instead~ 代替〜
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.