<!DOCTYPE html>
<html ng-app="nameApp">
    <head>
        <meta charset="utf-8">
        <title>Angular.js Example</title>
        <script src="/js/components/angular/angular.js"></script>
        <script>
            var nameApp = angular.module('nameApp', []);

            nameApp.controller('NameCtrl', function ($scope, $timeout){
                $scope.firstName = 'John';
                $scope.lastName = 'Doe';

                $scope.$watch('lastName', function(newValue, oldValue){
                    console.log('new value is ' + newValue);
                });

                setTimeout(function(){
                    $scope.lastName = 'Smith';
                    $scope.$apply();
                }, 1000);
            });
        </script>
    </head>
    <body ng-controller="NameCtrl">
        <div>
            First name: <input ng-model="firstName" type="text"/>
            <br>
            Last name: <input ng-model="lastName" type="text"/>
            <br>
            Hello {{firstName}} {{lastName}}
        </div>
    </body>
</html>

<!DOCTYPE html>
<html ng-app="nameApp">
    <head>
        <meta charset="utf-8">
        <title>Angular.js Example</title>
        <script src="/js/components/angular/angular.js"></script>
        <script>
            var nameApp = angular.module('nameApp', []);

            nameApp.controller('NameCtrl', function ($scope){
                $scope.firstName = 'John';
                $scope.lastName = 'Doe';

                $scope.$watch('lastName', function(newValue, oldValue){
                    console.log('new value is ' + newValue);
                });

                setTimeout(function(){
                    $scope.lastName = 'Smith';
                    $scope.$apply();
                }, 1000);
            });
        </script>
    </head>
    <body ng-controller="NameCtrl">
        <div>
            First name: <input ng-model="firstName" type="text"/>
            <br>
            Last name: <input ng-model="lastName" type="text"/>
            <br>
            Hello {{firstName}} {{lastName}}
        </div>
    </body>
</html>

Remove unused and obsolete $timeout from example 8
Remove unused and obsolete $timeout from example 8
