Angular scope data sharing pattern¶
In AngularJS (specifically version 1.3), data can be shared between different parts of an application by ensuring that the controllers involved reference the same data source^[angular-01.md]. This is often visualized and implemented by binding multiple controllers or directives to a shared object or scope property, rather than duplicating the data itself^[angular-01.md].
Implementation¶
The primary mechanism for this pattern is ensuring that the "數據來源相同" (data source is identical).^[angular-01.md] By accessing a single source of truth, updates in one controller are immediately reflected in others that depend on the same data.
Related Concepts¶
- [[Angular Scope]]
- [[AngularJS Controller]]
- [[Model-View-ViewModel (MVVM)]]
Sources¶
- angular-01.md