3

I am using web3@0.20 inside angular to call smart contract functions,

I want to know how to watch a smart contract event in angular?

using javascript is easy and it works :

sEvent.watch(function(error, result){
        if (!error)
        {
            console.log(result);
        } else {
            console.log(error);
        }
    });
2

I tried to use .watch and it works also in angular,

0

I would wrap everything inside a service and use an observable to update the component and so its UI

0

I think you will find the full answer to your question in this course : https://www.udemy.com/blockchain-ninja-develop-ethereum-dapp-with-angular/ but in my opinion you can start by using an Event Listener function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.