🇬🇧 English · 🇹🇷 Türkçe · 🇪🇸 Español · 🇩🇪 Deutsch · 🇫🇷 Français · 🇯🇵 日本語 · 🇨🇳 中文 · 🇮🇹 Italiano · 🇧🇷 Português · 🇮🇳 हिंदी
Two Angular 16 standalone components mounted side by side by one Tuvix.js shell, with no zone.js on the page.
| Package | Role |
|---|---|
@tuvix.js/core |
Shell orchestrator |
@tuvix.js/angular |
createAngularMicroApp wrapper |
npx create-tuvix-app@latest --example with-angular my-app
cd my-app
npm install
npm run devgit clone https://github.com/yasinatesim/tuvix.js.git
cd tuvix.js/examples/with-angular
pnpm install
pnpm devOpen http://localhost:4200.
with-angular/
├── angular.json ← "polyfills": [] (no zone.js)
└── src/
├── main.ts ← shell: registers both apps with loader-function entries
├── apps/
│ ├── home.ts ← createAngularMicroApp({ name: 'home', component: HomeApp })
│ └── profile.ts
└── app/
├── home.component.ts ← standalone, @Input() name, click counter
└── profile.component.ts ← standalone, @Input() theme
createAngularMicroApp({ name, component })bootstraps the component into its own host element inside the container. Passmoduleas well when the component is declared in an NgModule.- Inputs: the shell's
propsare set withsetInputbefore the first change detection, songOnInitalready seesnameandtheme. - Zoneless: the adapter never loads zone.js. Angular 16 has no zoneless scheduler, so
HomeAppcallsChangeDetectorRef.detectChanges()after its click. Angular 18 and later schedule change detection for you. - Code splitting: each
entryis() => import('./apps/home'), so the Angular CLI emits one lazy chunk per app. - Monorepo note:
tsconfig.jsonmaps@angular/*andrxjsto this example'snode_modules. Inside the pnpm workspace,@tuvix.js/angularis a symlink and would otherwise resolve its own copy of@angular/core, which fails withNG0203. A project that installs@tuvix.js/angularfrom npm does not need the mapping.