In this video, Aviv Ben-Yosef explains what one-way data flow is. Learn how combining it with immutable models makes for code that is a lot more performant and easier to reason about.
- [Instructor] As part of moving an app to use…one-way binding, its architecture also gets pushed…towards a one-way data flow.…Think of an app as a tree of components,…the root being the app component.…With one-way data flow, data is passed from each parent…to its children components using one-way bindings.…That means only a parent can change the data…models directly, and then, children get updated.…For example, in their $onChanges hook.…Children, on the other hand, notify their parents…of changes to the data instead of updating it themselves,…usually using function calls or callbacks.…
This is called one-way data flow, because components…don't directly manipulate models they're given,…only models that belong to them.…This mode of communication is clear and more visible.…It also lines up with the modern approach…for managing with lots of state in a big app.…One-way data flow, unsurprisingly, resembles the structure…of apps in Angular 2 and provides another step…in modernizing an existing app.…One-way data flow reaches its full potential…
Aviv Ben-Yosef kicks off the course by explaining what's different in Angular 1.6, as well the different motives for upgrading. Next, he walks through how to safely upgrade an existing app. He covers going from controllers to directives, as well as component lifecycle hooks. He also goes into the architectural changes in Angular, such as one-way data flow and immutability. To wrap up, he discusses how to properly test components.
- Deciding to upgrade an existing app
- Upgrading to Angular 1.6
- Removing standalone controllers
- Using directives as route targets
- Converting a controller's code
- Converting a controller's template
- Comparing directives and components
- Converting a directive
- Reviewing the concept of one-way binding
Skill Level Intermediate
AngularJS 1: Building a Data-Driven Appwith Ray Villalobos2h 15m Intermediate
1. Controllers to Directives
2. Use controllerAs
Convert a controller’s code1m 57s
3. Directives to Components
4. Component Lifecycle Hooks
5. One-Way Data Binding
6. Testing Components
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.