这是我的异步验证器它没有去抖时间,我该如何添加它?
static emailExist(_signupService:SignupService) {
return (control:Control) => {
return new Promise((resolve, reject) => {
_signupService.checkEmail(control.value)
.subscribe(
data => {
if (data.response.available == true) {
resolve(null);
} else {
resolve({emailExist: true});
}
},
err => {
resolve({emailExist: true});
})
})
}
}
Run Code Online (Sandbox Code Playgroud) 我一直在考虑这个问题,似乎无法找到答案.Node.js和V8之间有什么关系?并且Node.js可以在没有V8的情况下工作吗?
我运行eb init和部署,我得到 node.js 版本 6,我如何在执行eb init命令时指定我想要 node.js 版本 8 ?
所以我有以下查询:
const [discussions, total] = await em
.createQueryBuilder(Discussion, 'd')
.select(['d', 'u.id', 'u.firstName', 'u.lastName', 'u.image'])
.addSelect(
qb =>
qb
.select('COUNT(*)', 'commentCount')
.from(Comment, 'c')
.where('c.discussion_id = d.id'),
'commentCount',
)
.leftJoin('d.user', 'u', 'd.user_id = u.id')
.where('d.project_id = :projectId', { projectId })
.orderBy({ 'd.updated_date': 'DESC' })
.limit(limit)
.offset(offset)
.getManyAndCount();
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,我正在添加一个子查询选择。
查询执行成功,但discussions数组没有commentCount返回属性。
我缺少什么?