title: javascript pattern used in angular
body: <p>I followed a AngularJS tutorial on <a href="http://www.tutorialspoint.com/angularjs/angularjs_services.htm" rel="nofollow">http://www.tutorialspoint.com/angularjs/angularjs_services.htm</a></p>
  
  <p>The method passed to CalcService service got me confused. Is Angular using revealing prototype or a different one. I was confused because that inner function declared in <code>this.square</code> should be private and not visible outside the context of the object. How Angular is able to access square.</p>
  
  <pre><code>mainApp.service('CalcService', function(MathService){
              this.square = function(a) { 
              return MathService.multiply(a,a); 
           }
  });
  </code></pre>