Angular website integrating webassembly computations built and used as content material for this article : http://blog.3ie.fr/webassembly-angular/
This project was generated with Angular CLI.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build. You can also run npm install.
Run ng serve --port 4200 for a dev server on port 4200, or simply run npm start.
Run ng generate component component-name to generate a new component.
To compile C to WASM use the following instructions (you must install emsdk / emcc):
./emdsk update
./emdsk update-tags
./emdsk install latest
./emdsk activate latest
source ./emdsk_env.sh
cd app/src/wasm
emcc ./evaluator.c -Os -s WASM=1 -s MODULARIZE=1 -o ./evaluator.js
I added the raws .js and .wasm files in src/app/wasm in case of you were having trouble to compile emsdk by yourself ;-).
Léo Stephan