Guide
Quick start
From an empty directory to an Angular app running on native views, on the platform of your choice.
Requirements
Section titled “Requirements”Xcode with the simulator runtime for the platform you want. tvOS and
visionOS ship theirs separately: xcodebuild -downloadPlatform tvOS.
tvOS, visionOS and watchOS also need a nightly Rust toolchain — their Rust
targets are tier 3 and ship no prebuilt std:
rustup toolchain install nightlyrustup component add rust-src --toolchain nightlyThe Android SDK, found through ANDROID_HOME or its usual location, plus
the NDK. There is no Gradle here: an drives aapt2, javac, d8 and
apksigner itself.
The Material 3 dependencies are resolved once:
python3 scripts/fetch-android-deps.pypython3 scripts/prepare-android-deps.pyXcode’s command line tools and nothing else. There is no simulator: the app runs on the machine you build it on.
Install the CLI
Section titled “Install the CLI”-
Clone this repository and put
anon your PATH:Terminal window git clone https://github.com/nesgarbo/angular-nativecd angular-nativecargo install --path crates/an-cli -
Create an Angular project, or use one you already have:
Terminal window npx @angular/cli@latest new my-appcd my-app -
Set it up:
Terminal window an initThis adds a manifest, a native tsconfig, the two framework packages and a native entry point. It touches neither
src/main.tsnorangular.json, song buildandng servekeep working exactly as before. -
Add a platform and run it:
Terminal window an add ios && an iosan add tvos && an tvos .an add visionos && an visionos .Terminal window an add android && an androidan wearos .Terminal window an macos .
Develop with hot refresh
Section titled “Develop with hot refresh”an dev # iPhone simulatoran dev --android # Android emulatoran dev --tvos # Apple TV simulatoran dev --visionos # Vision Pro simulatoran dev --watchos # Apple Watch simulatoran dev --wearos # Wear OS emulatoran dev --macos # a window on this Mac--macos is the odd one out: there is no simulator, so the app opens on the
machine that is compiling it and the server it talks to is on that same machine.
Saving a component swaps its definition in the running app. You stay on the same screen, with whatever you had typed and the timers still running.
Your first template
Section titled “Your first template”<an-view [style.padding]="'16'" [style.gap]="'12'"> <an-text [fontSize]="28" [fontWeight]="'bold'">Settings</an-text>
<an-view [style.flexDirection]="'row'" [style.justifyContent]="'space-between'"> <an-text>Notifications</an-text> <an-switch [on]="notify()" (onChange)="notify.set($event)" /> </an-view>
<an-button [title]="'Save'" [variant]="'filled'" [accessibilityHint]="'saves without leaving the screen'" (press)="save()" /></an-view>That an-switch is a UISwitch on iOS and a MaterialSwitch on Android.
Layout is flexbox, computed once in the core and handed to every platform as
absolute frames.