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
Angular's Future without NgModules: Architectur...
Search
Manfred Steyer
PRO
October 25, 2022
Programming
0
300
Angular's Future without NgModules: Architectures with Standalone Components
Manfred Steyer
PRO
October 25, 2022
Tweet
Share
More Decks by Manfred Steyer
See All by Manfred Steyer
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
700
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
400
Your Architecture as a Crime Scene: Improvements with Forensic Analysis
manfredsteyer
PRO
0
21
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
410
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
270
Your Architecture as a Crime Scene: Improvements with Forensic Analysis @ijs Munich 2024
manfredsteyer
PRO
0
330
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
170
Micro Frontends Unmasked: Opportunities, Challenges, Alternatives @w-jax 2024 München
manfredsteyer
PRO
0
170
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
170
Other Decks in Programming
See All in Programming
定理証明プラットフォーム lapisla.net
abap34
1
1.7k
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
770
Amazon Bedrock Multi Agentsを試してきた
tm2
1
280
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
110
Domain-Driven Transformation
hschwentner
2
1.9k
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
340
Bedrock Agentsレスポンス解析によるAgentのOps
licux
2
720
sappoRo.R #12 初心者セッション
kosugitti
0
230
Honoとフロントエンドの 型安全性について
yodaka
4
250
さいきょうのレイヤードアーキテクチャについて考えてみた
yahiru
3
730
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
210
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
210
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
335
57k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Building Applications with DynamoDB
mza
93
6.2k
Being A Developer After 40
akosma
89
590k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Typedesign – Prime Four
hannesfritz
40
2.5k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
Transcript
@ManfredSteyer Angular's Future without NgModules: Architectures with Standalone Components
@ManfredSteyer
@ManfredSteyer @Component({ standalone: true, selector: 'app-root', imports: [ HomeComponent, AboutComponent,
], templateUrl: '…' }) export class AppComponent { […] }
@ManfredSteyer
@ManfredSteyer #1 Routing & Lazy Loading #2 Structuring Applications
@ManfredSteyer Manfred Steyer
@ManfredSteyer
@ManfredSteyer bootstrapApplication(AppComponent, { providers: [ […] ] });
@ManfredSteyer bootstrapApplication(AppComponent, { providers: [ MyGlobalService, importProvidersFrom(HttpClientModule), importProvidersFrom(RouterModule.forRoot(APP_ROUTES)), ] });
@ManfredSteyer bootstrapApplication(AppComponent, { providers: [ MyGlobalService, importProvidersFrom(HttpClientModule), provideRouter(APP_ROUTES, withPreloading(PreloadAllModules), withDebugTracing(),
), ] });
@ManfredSteyer export const APP_ROUTES: Routes = [ […], { path:
'flight-booking', loadChildren: () => import('@nx-example/booking/feature-book') .then(m => m.FLIGHT_BOOKING_ROUTES) }, […] ];
@ManfredSteyer export const APP_ROUTES: Routes = [ […], { path:
'flight-booking', loadChildren: () => import('@nx-example/booking/feature-book') .then(m => m.FLIGHT_BOOKING_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 FLIGHT_BOOKING_ROUTES: Routes = [{ path: '', component:
FlightBookingComponent, providers: [ MyService ], children: [ […] ] }];
@ManfredSteyer export const FLIGHT_BOOKING_ROUTES: Routes = [{ path: '', component:
FlightBookingComponent, providers: [ MyService ], children: [ […] ] }]; Scope: This route + all child routes (Lazily) loaded with route config If possible, use providedIn: 'root'
@ManfredSteyer export const FLIGHT_BOOKING_ROUTES: Routes = [{ path: '', component:
FlightBookingComponent, providers: [ provideState(bookingFeature), provideEffects([BookingEffects]) ], children: [ […] ] }];
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer // index.ts == Public API export * from './flight-booking.routes';
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer + Generates path mappings + Generates initial barrel +
Prevents bypassing index.ts + Restricting access between libraries
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer Free eBook (brand new) ANGULARarchitects.io/standalone-book Standalone Components Download here:
@ManfredSteyer provideRouter & withXYZ Directly point to lazy router configs
Folders & Barrels Nx, Libs, and Constraints FTW!
@ManfredSteyer d Slides & Examples Remote Company Workshops and Consulting
http://angulararchitects.io