You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$apply: all watchers are checked, the entire application starts the $digest loop. $digest: starts the $digest cycle for the current scope and its children. You should notice that the parents scopes will not be checked and not be affected.
The text was updated successfully, but these errors were encountered:
入门资源
使用感受
2015/9/23 @ufologist
最痛苦的莫过于作用域(scope)了, 有时候真不知道这个数据是从哪个作用域(子作用域基于原型链继承父作用域)上下来的
双向数据绑定是把双刃剑, 带来了方便也带来了混乱, 就怕子作用域不小心修改到了父作用域的东西
scope 中放两种数据共同组成一个界面
例如: 一个界面中表单的 select 控件, 它需要基础数据来填充选项, 因此会用
vm.keywords
来做初始化数据的绑定. 对于选中的值(需要从keywords
中选), 就是直接映射到界面的数据模型, 因此会用model.keyword
绑定用于的选择项, 继而提交给后端.常见问题
AngularJS: $digest vs $apply
The text was updated successfully, but these errors were encountered: