title: How to call a service function in AngularJS ng-click (or ng-change, ...)?
body: <p>When calling a function like this:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;select ng-model="var" ng-change="myFunction(var)"&gt;
    &lt;option ng-repeat="option in alloptions"&gt;{{option}}&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$scope.myFunction = function(){//do things}
  </code></pre>
  
  <p>it all works perfectly but when my function is within a service (which can be reached by the controller) the function doesn't get called. calling it by putting the service name as a prefix is also not an option (even though this works within javascript code itself) <code>myService.myFunction(var)</code></p>
  
  <p>So my question: what is the proper way to call services in ng-change when they are located in a service?</p>
  
  <p>thanks in advance</p>