I have a function that calls a method via callback. When the promise resolves and returns a value after then
, I am calling a method via await
keyword. So it looks like
function test() {
contract.setName(value).send({}).then(async function (data) {
var result = await this.getResult(data);
}
}
However, I get an error
Uncaught (in promise) TypeError: Cannot read property 'getResult' of undefined
Am I not allowed to use async/await
method after callback?