0

In line 14 of http://plnkr.co/edit/KuHG70qx64DnBGnQJ9kC?p=preview

We see the usage of scope.$apply. In normal case we don't need that, is it because of the scope different we use that? In that case, the param of scope refer to what? The main controller scope?

I'm confused..

Santosh Panda
  • 7,235
  • 8
  • 43
  • 56

1 Answers1

1

To know more about $apply and $digest cycle, refer

AngularJS provides two way binding by digest cycle. Two way binding needs to know when and where the changes made. To achieve this, angularjs has digest cycle which will keep on checking variables for the changes. Somecases, angularjs cannot capture the changes. In those scenerio, we have to tell angularjs about changes by calling $scope.$apply.

Community
  • 1
  • 1
Fizer Khan
  • 88,237
  • 28
  • 143
  • 153