NEO•ONE has first-class integration with Angular applications.
Integrating NEO•ONE with Angular is a breeze using the generated NEO•ONE client APIs.
The NEO•ONE toolchain emits an Angular Service that aids in integrating an Angular application with NEO•ONE: ContractsService
.
The ContractsService
can be injected into any component or service in which you need access to the client APIs or smart contract methods.
The ContractsService
makes responding to updates in the blockchain easy by providing access to Observables. Here’s how you might use the ContractsService
to build a simple Angular component to update the current block count.
-browserify
suffix. So, @neo-one/client
is imported as @neo-one/client-browserify
. If you’re importing @neo-one/suite
, then import the browserified version with @neo-one/suite-browserify
.allowSyntheticDefaultImports
must be set to true
in the top level tsconfig.json
.(window as any).global = window;
must be added in the polyfill.ts
file.