Comments (10)
Generating the code and refactoring the existing code starting around here: https://github.com/Quintor/angular-truffle-box/blob/master/src/app/meta/meta-sender/meta-sender.component.ts#L31 should be doable. The type of the MetaCoin would then be the specific contract, rather than any. I also tend to do the calls with .sendTransaction or .call explicitly, which I don't think the TypeChain library supports?
I'd be happy to accept a PR that does this cleanly. If I were to start working on it myself, I'll post it here.
from angular-truffle-box.
OK @pimotte,
Please!
I didn't understand meta-sender.component.ts, If i would like to give you sample smart contract so that give me an example of angular-truffle.
"pragma solidity ^0.4.8;
contract Storage {
uint256 storedData;
function set(uint256 data) {
storedData = data;
}
function get() constant returns (uint256) {
return storedData;
}
}"
Please! @pimotte
from angular-truffle-box.
https://github.com/Quintor/angular-truffle-box/blob/master/src/app/meta/meta-sender/meta-sender.component.ts#L63 and https://github.com/Quintor/angular-truffle-box/blob/master/src/app/meta/meta-sender/meta-sender.component.ts#L81 are the lines where the contract interaction happens. If you want to do that with TypeChain, you should end up with the needed object around those lines.
In general, using TypeChain with angular shouldn't be that different from using other libraries from angular, except maybe that the code is generated.
from angular-truffle-box.
I am ok in typechain but i need this please
"pragma solidity ^0.4.8;
contract Storage {
uint256 storedData;
function set(uint256 data) {
storedData = data;
}
function get() constant returns (uint256) {
return storedData;
}
}"
web3.services.ts alwys contant i think
from angular-truffle-box.
If you want to implement an application that uses that contract, I recommend forking this repo and throwing away meta-sender.component.ts, and implement a new component that interacts with it.
This Truffle box already has the MetaCoin contract as an example, so an additional contract is not needed.
from angular-truffle-box.
Error
Constructor: [object Object]
meta-sender.component.ts:28 OnInit: [object Object]
meta-sender.component.ts:29 MetaSenderComponent {web3Service: Web3Service, model: Object, status: ""}model: Objectstatus: ""web3Service: Web3Service__proto__: Object
core.js:3675 Angular is running in the development mode. Call enableProdMode() to enable the production mode.
core.js:1440 # ERROR TypeError: web3_1.default is not a constructor
at Web3Service.bootstrapWeb3 (web3.service.ts:26)
at eval (web3.service.ts:18)
at ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:4724)
at ZoneDelegate.invokeTask (zone.js:420)
at Zone.runTask (zone.js:188)
at ZoneTask.invokeTask [as invoke] (zone.js:496)
at invokeTask (zone.js:1517)
at globalZoneAwareCallback (zone.js:1543)
defaultErrorLogger @ core.js:1440
ErrorHandler.handleError @ core.js:1501
next @ core.js:5491
schedulerFn @ core.js:4319
SafeSubscriber.__tryOrUnsub @ Subscriber.js:240
SafeSubscriber.next @ Subscriber.js:187
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
Subject.next @ Subject.js:56
EventEmitter.emit @ core.js:4299
(anonymous) @ core.js:4755
ZoneDelegate.invoke @ zone.js:388
Zone.run @ zone.js:138
NgZone.runOutsideAngular @ core.js:4681
onHandleError @ core.js:4755
ZoneDelegate.handleError @ zone.js:392
Zone.runTask @ zone.js:191
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1517
globalZoneAwareCallback @ zone.js:1543
from angular-truffle-box.
Did you get any errors when installing dependencies?
from angular-truffle-box.
"web3": "^1.0.0-beta.26"
it is not work for me then i install "web3": "^0.20.4" and this is work
but i get error https://github.com/Quintor/angular-truffle-box/blob/master/src/app/util/web3.service.ts#26
from angular-truffle-box.
I like your video in youtue
Error
https://github.com/Quintor/angular-truffle-box/blob/master/src/app/util/web3.service.ts#26
from angular-truffle-box.
If any of these issues still exist, feel free to create a new issue with a description how to reproduce them.
from angular-truffle-box.
Related Issues (20)
- Trouble unboxing package HOT 7
- ERROR TypeError: web3_1.default is not a constructor HOT 5
- Error HOT 4
- Create Dockerfile HOT 1
- web3_1.default is not a constructor HOT 18
- Event example HOT 2
- Use Ganache instead of TestRPC HOT 4
- Updating angular cli to version 1.6.2 causes karma tests to fail HOT 2
- When try to unbox, can't find Python executable even it is already installed HOT 4
- Error: Contract has not been deployed to detected network (network/artifact mismatch) HOT 2
- Upgrade to angular 6.0 HOT 2
- Having trouble unboxing this box HOT 2
- Update to Angular 7 HOT 1
- accounts balance happend but dont refresh on ganache or metamask HOT 5
- Remove node-gyp subdependencies
- Revisit web3 integration
- truffle unbox Quintor/angular-truffle-box command problems HOT 3
- this truffle cant work with Metamask since this year (Chrome) HOT 1
- Unbox failing on windows 10 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-truffle-box.