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
Lazy Loading und Preloading mit Angular, Präse...
Search
Manfred Steyer
PRO
November 26, 2016
Programming
0
270
Lazy Loading und Preloading mit Angular, Präsentation von ngGraz, November 2016
Manfred Steyer
PRO
November 26, 2016
Tweet
Share
More Decks by Manfred Steyer
See All by Manfred Steyer
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
150
AI Assistants for YourAngular Solutions @Angular Graz, March 2026
manfredsteyer
PRO
0
92
AI Assistants for Your Angular Solutions @ngVienna March 2026
manfredsteyer
PRO
0
56
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
160
Nostalgia Meets Technology: Super Mario with TypeScript
manfredsteyer
PRO
0
110
Full Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
78
Premier Disciplin for Micro Frontends Multi Version/ Framework Scenarios @OOP 2026, Munic
manfredsteyer
PRO
0
230
Beyond the Basics: Signal Forms
manfredsteyer
PRO
0
140
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
230
Other Decks in Programming
See All in Programming
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
160
ファインチューニングせずメインコンペを解く方法
pokutuna
0
180
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
300
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
220
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
180
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
500
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
1.1k
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
7
3.1k
AI活用のコスパを最大化する方法
ochtum
0
330
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
100
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
640
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
For a Future-Friendly Web
brad_frost
183
10k
Mind Mapping
helmedeiros
PRO
1
130
A Modern Web Designer's Workflow
chriscoyier
698
190k
KATA
mclloyd
PRO
35
15k
Bash Introduction
62gerente
615
210k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
230
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
160
Transcript
Lazy Loading und Preloading mit Angular 2 Manfred Steyer
About me … • Manfred Steyer • SOFTWAREarchitekt.at • Trainer
& Consultant • Focus: Angular • Google Developer Expert Page 2 Manfred Steyer
Inhalt • Lazy Loading • Preloading • Nutzung von Shared
Modules Page 3
Lazy Loading Page 4
Modul-Struktur Page 5 AppModule … … … SharedModule Root
Module Feature Modules Shared Module
Root Module mit Lazy Loading Page 6 const APP_ROUTE_CONFIG:
Routes = [ { path: '', redirectTo: 'home', pathMatch: 'full' }, { path: 'home', component: HomeComponent }, { path: 'flights', loadChildren: './[…]flight-booking.module#FlightBookingModule' } ];
Routen für Feature Module Page 7 const FLUG_ROUTES =
[ { path: '', component: FlugBuchenComponent, […] }, […] }
Konfiguration von Webpack • angular2-router-loader • Splittet Bundle in mehrere
Teile Page 8
DEMO Page 9
Preloading Page 10
Idee • Eventuell später benötigte Module werden nach (!) Anwendungsstart
geladen • Wird das Modul später tatsächlich benötigt, steht es augenblicklich zur Verfügung Page 11
Preloading aktivieren Page 12 export const AppRoutesModule = RouterModule.forRoot(
ROUTE_CONFIG, { preloadingStrategy: PreloadAllModules });
DEMO Page 13
Lazy Loading und Shared Services Page 14
DEMO Page 15
Lazy Loading und Shared Modules Page 16 AppModule FlugModule
SharedModule includes includes (lazy) includes
Lazy Loading und Shared Modules Page 17 AppModule FlugModule
SharedModule includes includes (lazy) includes AuthService AuthService
Lösung Page 18 AppModule FlugModule SharedModule includes (inkl. Provider)
includes (lazy) includes (exkl. Provider) AuthService
Shared Module Page 19 @NgModule({ […], providers: [] })
export class SharedModule { }
Shared Module Page 20 @NgModule({ […], providers: [] })
export class SharedModule { static forRoot(): ModuleWithProviders { return { ngModule: SharedModule, providers: [AuthService, […]] } } }
DEMO Page 21
Zusammenfassung Page 22 Lazy Loading von Modulen webpack splittet
Bundle Preloading Strategy Shared Modules mit und ohne Provider
Kontakt [mail]
[email protected]
[blog] SOFTWAREarchitekt.at [twitter] ManfredSteyer