?
Real Time Updates
I hereby declare AngularJS to be MVW framework - Model-View-Whatever. Igor Minar
[source]
Where Whatever stands for "whatever works for you".
Insanity Warning // yes, this code is a bit crazy, but it works and we have tests to prove it! [source]
<div>Hello, {{ user.name }}</div>
$scope.user = { name: 'Valentyn' }
<div>Hello, Valentyn</div>
POJO
$scope.user.name = 'Sergey'
<div>Hello,Sergey</div>
<div class="ng-binding">Hello,{{ user.name }}</div>
  1. Parse template
  2. Compile into
    function(context) → string
  3. Add "watcher"
    $scope.$watch('user.name', ...)
function changeName(newName) {
  $scope.user.name = newName;
}
changeName('x')
$scope.$apply(function() {
  changeName('x');
});
AngularJS runtime
Enter AngularJS context call changeName('x') enter $digest loop check all $watch expressions Re-render DOM
Web Server Web Browser Web Browser Web Browser Object State Object State Object State $scope View $watch Demo Q&A Thank you!
Valentyn Shybanov
http://olostan.name/
olostan@gmail.com