title: $watch a return value of a function
body: <p>I am new to AngularJs and I am using angular 1.4.
  The issue is:
  I am using a simple counter object defined like this:</p>
  
  <pre><code>var myCounter = (function(){
                      var count =0;
                      return {
                          "inc": function(){
                              count++;
                          },
                          "dec": function(){
                              if(count&gt;0){
                                  count--;
                              }
                          },
                          "getCount": function(){
                              return count;
                          }
                      };
                  })();
  </code></pre>
  
  <p>I would like to keep the count variable private and read the value only through 'getCount' function.</p>
  
  <p>Whenever the count increases/decreases I have to perform a set of operations based on the updated value of 'count'. For this I want to use '$watch' to observe the changes. But I can get the value only by invoking the function 'getCount()'. </p>
  
  <p>Please suggest how do I write a '$watch' in this scenario. If this is not a correct approach, please suggest a better one.</p>
  
  <p>Thanks in advance!</p>