在Angular5项目中使用以下Typescript代码: expense.id = uuidv4(return this.http.post(`${this.apiUrl}/expenses/`, json, options) }我得到一个编译器错误[ts] Type 'Promise<Response>' is not as
类型记录将检查未知属性:interface IReturnVal { b:specify known properties, and 'c' does not exist in type 'IReturnVal'.ts(2322)}
但是,如果函数返回允诺return Promise.resolve({
result.insertedCount); //close the database connection });但是,当我命中端点时,它返回以下错误originated either by throwing inside of an async function without a catch block, or by rejecting a promise(rejection id: 1)
我很困惑,因为方法调用被包装在