// app.counterController.js

(function() {
  "use strict";

  angular.module("CounterApp")
    .controller("CounterController", CounterController);

  CounterController.$inject = ["$scope"];

  function CounterController($scope) {
    $scope.onceCount = 0;
    $scope.counter = 0;

    $scope.showNumberOfWatchers = showNumberOfWatchers;
    $scope.countOnce = countOnce;
    $scope.increment = increment;

    function showNumberOfWatchers() {
      console.log("# of Watchers", $scope.$$watchersCount);
    }

    function countOnce() {
      $scope.onceCount = 1;
    }

    function increment() {
      $scope.counter++;
    }

    $scope.$watch("onceCount", (newValue, oldValue) => {
      console.log("onceCount newValue: ", newValue);
      console.log("onceCount oldValue: ", oldValue);
    });

    $scope.$watch("counter", (newValue, oldValue) => {
      console.log("counter newValue: ", newValue);
      console.log("counter oldValue: ", oldValue);
    });
  }
})();

@@ -143,16 +143,19 @@
 ler);%0A%0A 
+ /*
  Counter
@@ -631,177 +631,402 @@
   %7D%0A
-%0A    $scope.$watch(%22onceCount%22, (newValue, oldValue) =%3E %7B%0A      console.log(%22onceCount newValue: %22, newValue);%0A      console.log(%22onceCount oldValue: %22, oldValue
+  %7D */%0A%0A  CounterController.$inject = %5B%22$scope%22%5D;%0A%0A  function CounterController($scope) %7B%0A    let vm = this;%0A%0A    vm.onceCount = 0;%0A    vm.counter = 0;%0A    vm.name = %22Vitalii%22;%0A%0A    vm.showNumberOfWatchers = showNumberOfWatchers;%0A    vm.countOnce = countOnce;%0A    vm.increment = increment;%0A%0A    function showNumberOfWatchers() %7B%0A      console.log(%22# of Watchers%22, $scope.$$watchersCount
 );%0A    %7D
 );%0A%0A
@@ -1025,166 +1025,188 @@
    %7D
-);
 %0A%0A    
-$scope.$watch(%22counter%22, (newValue, oldValue) =%3E %7B%0A      console.log(%22counter newValue: %22, newValue);%0A      console.log(%22counter oldValue: %22, oldValue
+function countOnce() %7B%0A      vm.onceCount = 1;%0A    %7D%0A%0A    function increment() %7B%0A      vm.counter++;%0A    %7D%0A%0A    $scope.$watch(() =%3E %7B%0A      console.log(%22Digest Loop Fired!!!%22
 );%0A 

Test Digest Cycle