title: AngularJS - what are the major differences in the different ways to declare a service in angular?
body: <p>I am working on an angularJS app and I am trying to stick with the most efficient and widely accepted styles of development in AngularJs. 
  Currently, I am using this way of declaring my services like so:</p>
  
  <pre><code>app.factory('MyService', function() {
    /* ... */
    function doSomething(){
       console.log('I just did something');
  
    }
  
    function iAmNotVisible(){
        console.log('I am not accessible from the outside');
    }
    /* ... */
  
    return{
       doSomething: doSomething
    };
  });
  </code></pre>
  
  <p>However, there are numerous examples out there and I am not quite sure which design style to follow. Can someone with extensive knowledge about services explain the reason why a certain style is more relevant than another?</p>
  
  <p>Is what I am doing useful in any way other than restricting the access to certain functions in my service?</p>