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
Databinding in Angular 2
Search
Manfred Steyer
PRO
October 25, 2016
Programming
0
190
Databinding in Angular 2
Manfred Steyer
PRO
October 25, 2016
Tweet
Share
More Decks by Manfred Steyer
See All by Manfred Steyer
Micro Frontends with Modern Angular and Island Architectures @ijs London 2024
manfredsteyer
PRO
0
59
Modern State Management in Angular: 3+n Flavors of the Signal Store @ijs London 2024
manfredsteyer
PRO
0
51
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
230
Migrating to Signals: A Practical Workshop
manfredsteyer
PRO
0
390
Micro Frontends with Web Standards
manfredsteyer
PRO
1
290
The New NGRX Signal Store for Angular: 3+n Flavors
manfredsteyer
PRO
1
210
Leveraging the new NGRX Signal Store
manfredsteyer
PRO
0
170
Modern State Management in Angular: The 3+n Flavors of the NGRX Signal Store
manfredsteyer
PRO
0
100
NGRX Signal Store
manfredsteyer
PRO
0
200
Other Decks in Programming
See All in Programming
Milestoner
bkuhlmann
1
400
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
180
本格ローグライク制作にEbitengineを選んでみた
nagainaganawa
0
290
Folding Cheat Sheet #2
philipschwarz
PRO
0
110
HUIT新歓2024「競技プログラミング、やってみませんか?」
slephy2784
1
250
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
2
100
オブジェクト指向のリ・オリエンテーション~歴史を振り返り、AI時代に向きなおる~
hanyudaeiiti
10
5.7k
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
190
[技育CAMPアカデミア]アイディアを形に!【超入門】スマホアプリ開発〜リリースまでの流れをご紹介
teamlab
PRO
0
350
SwiftUI Performance 不要なViewの再描画と更新を抑える
bigamitiongit
1
160
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.3k
PostmanでAPIの動作確認が楽になった話
h455h1
0
130
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
225
17k
Statistics for Hackers
jakevdp
789
220k
No one is an island. Learnings from fostering a developers community.
thoeni
14
2.1k
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Into the Great Unknown - MozCon
thekraken
10
980
How to name files
jennybc
64
92k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
24
2.3k
A designer walks into a library…
pauljervisheath
199
23k
Making the Leap to Tech Lead
cromwellryan
123
8.5k
The Language of Interfaces
destraynor
151
23k
Web development in the modern age
philhawksworth
202
10k
Building Adaptive Systems
keathley
30
1.8k
Transcript
Data Binding in Angular 2 Manfred Steyer
About me … • Manfred Steyer • SOFTWAREarchitekt.at • Trainer
& Consultant • GDE and MVP • Focus: Angular Page 2 Manfred Steyer
Data Binding in AngularJS 1.x Page 4 Model Model
Directive Nearly everything can depend on everything Leads to serveral digest cycles
Angular 2 Page 5 Component for whole App Component
(e. g. list) Component (e. g. list-item) Component (e. g. list-item)
Property Binding (One Way, Top/Down) Page 6 model item
item {{ item.title }} {{ item.title }} [http://victorsavkin.com/post/110170125256/change-detection-in-angular-2]
Property Binding (One Way, Top/Down) • Only one digest cycle
needed • Child component must not modify parent component (e. g. by using setters) • Angular 2 checks for this in dev mode
Event Bindings (One Way, Bottom/Up) Page 8 {{ item.title
}} {{ item.title }} Event-Handler Event-Handler
Event Bindings (One Way, Bottom/Up) • No digest cycle for
propagating events • But: Events can change state Updating Property Bindings Page 9
Property and Event Bindings Page 10 Performing Property Bindings
Executing Event Handlers Event occurs App is ready All handlers executed Properties bound
Two Way Binding Page 11 <input [(ngModel)]="from">
Two Way = Property and Event Bindings Page 12
<input [ngModel]="from" (ngModelChange)="from = $event"> Property + Change changed value
Summary • Property Binding: One Way; Top/Down • Event Binding:
One Way; Bottom/Up • Two Way = Property Binding + Event Binding • Conventions for Two Way Binding • Align to this conventions in own components Page 13
Contact [mail]
[email protected]
[blog] SOFTWAREarchitekt.at [twitter] ManfredSteyer