This project was created following the medium from Oz named Powering Angular with Rust (Wasm)
It use Angular 18.0.5 and Rust 1.78.0 with wasm_bindgen 0.2 to generate the web page.
You can see an example in the image bellow:
If you want to execute this program first you have to make some commands.
- Open a terminal where you had installed Rust
- Execute the command
cargo install wasm-pack
- Go tho the rust-lib folder
cd project/wasm-code/src/lib/rust-lib
- Execute the command
wasm-pack build --target web
, if is the first time, orwasm-pack build — target web
, if you had modified the library.
Run ng serve -o
for a dev server. Navigate to http://localhost:4200/
. The application will automatically reload if you change any of the source files.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.