title: Angular Service created function needs this keyword
body: <p>While the question is more I suppose javascript type question more so than an Angular question,  I was creating a service in which I would call it like this</p>
  
  <pre><code>// controller injects activityApi , then service function call is made
  var activities = activityApi.getActivityById(1122);
  </code></pre>
  
  <p>I get an error if I do not put "this" keyword in front of function name
  1. Why do I need "this."<br>
  2. What other alternatives?  ( I am trying to get into the habit of not doing old school javascript with  <code>function blah() { ... }</code> </p>
  
  <pre><code>this.getActivityById = function(id) {
          $http.get('/Umbraco/Api/ActivityApi/GetActivity').
              success(function (data, status, headers, config) {
              console.log(data);
              return data;
              }).
         error(function (data, status, headers, config) {
             // log error
         });
      };
  </code></pre>