Created
July 12, 2017 22:36
-
-
Save anonymous/6e4f27981c7f6d3bbea66919e39f198a to your computer and use it in GitHub Desktop.
Ok I figured it out using (<any>window).MyNamespace
.
Now I'm having trouble with these lines
return this.web3.eth.getBalance(PubAd, function(error, result){
if(!error)
/**console.log(String(result));*/
console.log(this.web3.fromWei(String(result), 'ether'));
else
console.error(error);
})
.map(response =>
response.json()
)
I'm getting two errors
- ERROR TypeError: Cannot read property 'map' of undefined.
- Cannot read property 'fromWei' of undefined
Looks like you're having scoping issues... Look into how scoping works in JavaScript
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah I'm using Metamask do I need to specify that somehow?
I found this link that talks about adding properties.