4

I am using [email protected] 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);
        }
    });

3 Answers 3

3

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 and acknowledge you have read our privacy policy.

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