Skip to content

islamyouniss/wasm-angular-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rustng

This project was meant to be implementation for wasm using rust and angular

first of we will create angular workspace using following command:

ng new rustng --create-application=false

then create angular library in this workspace

ng generate library rustyng

and generate angular application

ng generate application rustyng

install wasm rust package

cargo install wasm-pack

create rust library in the angular library directory src/lib

cargo new --lib example-rust-lib --vcs none

to build wasm use this command in rust lib directory:

wasm-pack build --target web

to load the wasm to your project you need to add this snippet to angular.json

      "architect": {
        "build": {
          "options": {
            "assets": [
              {
                "glob": "**/*.wasm",
                "input": "projects/rusty-wasm/src/lib/rusty-lib/pkg"
              }

Releases

No releases published

Packages

No packages published