Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Better Angular Architectures: Architectures wit...
Search
Manfred Steyer
PRO
July 05, 2022
Programming
1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Better Angular Architectures: Architectures with Standalone Components @DWX2022
Manfred Steyer
PRO
July 05, 2022
More Decks by Manfred Steyer
See All by Manfred Steyer
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
170
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
100
Nostalgia Meets Technology: Super Mario with TypeScript
manfredsteyer
PRO
0
170
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
230
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
150
Agentic UI
manfredsteyer
PRO
0
230
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
290
Agentic UI beyond Chats Architecture Patterns & Open Standards @ngMunich 05/2026
manfredsteyer
PRO
0
240
Agentic AI in the Frontend: Architectures with Open Standards @iJS London 2026
manfredsteyer
PRO
0
170
Other Decks in Programming
See All in Programming
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.4k
スマートグラスで並列バイブコーディング
hyshu
0
290
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
160
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.4k
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
170
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
270
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
220
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
350
初めてのKubernetes 本番運用でハマった話
oku053
0
120
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
200
Vite+ Unified Toolchain for the Web
naokihaba
0
740
継続モナドとリアクティブプログラミング
yukikurage
3
520
Featured
See All Featured
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.6k
Automating Front-end Workflow
addyosmani
1370
210k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
sira's awesome portfolio website redesign presentation
elsirapls
0
300
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
420
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.5k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
410
Writing Fast Ruby
sferik
630
63k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
2
330
Scaling GitHub
holman
464
140k
Balancing Empowerment & Direction
lara
6
1.2k
Transcript
@ManfredSteyer Better Angular Architectures: Architectures with Standalone Components
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer Angular 2 BETA, Feb 2016 @Component({ selector: 'app', directives:
[ROUTER_DIRECTIVES, MyComponent, NgIf, NgFor], templateUrl: 'app/app.html' }) @RouteConfig([ { path: '/', component: Home, … }, { path: '/voucher', component: Voucher, … }, ]) export class App { […] }
@ManfredSteyer Angular 2 RC.5, August 2016 import { NgModule }
from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; […] @NgModule({ imports: [BrowserModule, OtherModule], declarations: [AppComponent, OtherComponent, OtherDirective], providers: [], bootstrap: [AppComponent], }) export class AppModule {}
@ManfredSteyer Angular 2 RC.5, August 2016 import { NgModule }
from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; […] @NgModule({ imports: [BrowserModule, OtherModule], declarations: [AppComponent, OtherComponent, OtherDirective], providers: [], bootstrap: [AppComponent], }) export class AppModule {}
@ManfredSteyer Angular 2 RC.5, August 2016 import { NgModule }
from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; […] @NgModule({ imports: [BrowserModule, OtherModule], declarations: [AppComponent, OtherComponent, OtherDirective], providers: [], bootstrap: [AppComponent], }) export class AppModule {} TypeScript Modules Angular Modules
@ManfredSteyer My Ivy Talk at ng-conf 2020
@ManfredSteyer @Component({ standalone: true, selector: 'app-root', imports: [ HomeComponent, AboutComponent,
HttpClientModule, ], templateUrl: '…' }) export class AppComponent { […] }
@ManfredSteyer bootstrapApplication(AppComponent);
@ManfredSteyer
@ManfredSteyer #1 Mental Model #2 Compatibility #3 Routing #4 Architecture
@ManfredSteyer Manfred Steyer
@ManfredSteyer
@ManfredSteyer Standalone Component = Component + NgModule (not implemented that
way!)
@ManfredSteyer @Component({ standalone: true, selector: 'app-root', imports: [ RouterModule, HomeComponent,
AboutComponent, ], templateUrl: '…' }) export class AppComponent { […] } @NgModule({ imports: [ RouterModule, HomeComponentModule, AboutComponentModule, ], declares: [ AppComponent ] }) export class AppModule { … } @Component({ selector: 'app-root', templateUrl: '…' }) export class AppComponent { […] }
@ManfredSteyer @Pipe({ standalone: true, name: 'city', pure: true }) export
class CityPipe implements PipeTransform { […] }
@ManfredSteyer @Directive({ standalone: true, selector: 'input[appCity]', providers: [ … ]
}) export class CityValidator implements Validator { […] }
@ManfredSteyer @Component({ standalone: true, imports: [ […], FlightCardComponent, CityPipe, CityValidator,
], selector: 'flight-search', templateUrl: '…' }) export class FlightSearchComponent { […] }
@ManfredSteyer
@ManfredSteyer It looks like you want to use NgIfDirective and
MyComponent. Shall I import it for you?
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer → @Component({ standalone: true, selector: 'app-root', imports: [ […]
TicketsModule, ], templateUrl: '…' }) export class AppComponent { }
@ManfredSteyer → @Component({ standalone: true, selector: 'app-root', imports: [ […]
TicketsModule, ], templateUrl: '…' }) export class AppComponent { }
@ManfredSteyer → @NgModule({ imports: [ FlightCardComponent, ], declarations: [ MyTicketsComponent
], }) export class TicketsModule { }
@ManfredSteyer → @NgModule({ imports: [ FlightCardComponent, ], declarations: [ MyTicketsComponent
], }) export class TicketsModule { }
@ManfredSteyer bootstrapApplication(AppComponent, { providers: [ MyGlobalService, importProvidersFrom(HttpClientModule), importProvidersFrom(RouterModule.forRoot(APP_ROUTES)), ] });
@ManfredSteyer bootstrapApplication(AppComponent, { providers: [ MyGlobalService, importProvidersFrom(HttpClientModule), importProvidersFrom(RouterModule.forRoot(APP_ROUTES)), ] });
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer bootstrapApplication(AppComponent, { providers: [ MyGlobalService, importProvidersFrom(HttpClientModule), importProvidersFrom(RouterModule.forRoot(APP_ROUTES)), ] });
@ManfredSteyer bootstrapApplication(AppComponent, { providers: [ MyGlobalService, importProvidersFrom(HttpClientModule), provideRoutes(APP_ROUTES), ] });
@ManfredSteyer export const APP_ROUTES: Routes = [ […], { path:
'flight-booking', loadChildren: () => import('@nx-example/booking/feature-book') .then(m => m.FLIGHT_BOOKING_ROUTES) }, { path: 'next-flight', loadComponent: () => import('@nx-example/booking/feature-tickets') .then(m => m.NextFlightComponent) }, ];
@ManfredSteyer export const APP_ROUTES: Routes = [ […], { path:
'flight-booking', loadChildren: () => import('@nx-example/booking/feature-book') .then(m => m.FLIGHT_BOOKING_ROUTES) }, { path: 'next-flight', loadComponent: () => import('@nx-example/booking/feature-tickets') .then(m => m.NextFlightComponent) }, ];
@ManfredSteyer export const FLIGHT_BOOKING_ROUTES: Routes = [{ path: '', component:
FlightBookingComponent, providers: [ MyService ], children: [ […] ] }];
@ManfredSteyer export const FLIGHT_BOOKING_ROUTES: Routes = [{ path: '', component:
FlightBookingComponent, providers: [ MyService ], children: [ […] ] }]; (Lazily) loaded with route config Scope: This route + all child routes
@ManfredSteyer export const FLIGHT_BOOKING_ROUTES: Routes = [{ path: '', component:
FlightBookingComponent, providers: [ ...configureMyLibrary() ], children: [ […] ] }];
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer // index.ts == Public API export * from './flight-booking.component';
export * from './flight-card/flight-card.component';
@ManfredSteyer
@ManfredSteyer import * as booking from './booking'; […] @Component({ standalone:
true, imports: [ booking, […] ], […] }) export class MyComponent { […] } Wish List
@ManfredSteyer
@ManfredSteyer "paths": { "@demo/data": ["src/app/data/index.ts"], "@demo/shared": ["src/app/shared/index.ts"], "@demo/shell": ["src/app/shell/index.ts"], "@demo/booking":
["src/app/booking/index.ts"] }
@ManfredSteyer import * as booking from '@demo/booking'; […] @Component({ standalone:
true, imports: [ ...Object.values(booking) as any[], […] ], […] }) export class MyComponent { […] }
@ManfredSteyer
@ManfredSteyer + Generates path mappings + Generates initial barrel +
Prevents bypassing index.ts + much more
@ManfredSteyer
@ManfredSteyer Booking Boarding Shared Feature Feature Feature Feature Feature UI
UI UI UI UI UI UI UI UI Domain Domain Domain Domain Domain Domain Util Util Util Util Util Util @ManfredSteyer
@ManfredSteyer Free eBook (5th Edition) ANGULARarchitects.io/book Module Federation & Nx
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer Lib A Lib B index.ts Comp1 Comp2 Today (with
NgModules) NgModule Comp3 NgModule
@ManfredSteyer Lib A Lib B index.ts Comp1 Comp2 Tomorrow (without
NgModules) Comp3
@ManfredSteyer Conclusion Mental Model Folders & Barrels Mapped Paths Nx,
Libs, and Constraints FTW!
@ManfredSteyer 2022
@ManfredSteyer d Slides & Examples Remote Company Workshops and Consulting
http://angulararchitects.io