title: Angular ng-click with call to a controller function not working
body: <p>I need to pass a variable to another controller. I have the following code which is related to the ListCtrl :</p>
  
  <pre><code>&lt;a href="#items" data-router="article" ng-click="changeListName('metro')"&gt;
  </code></pre>
  
  <p>The link is going to another controller, ItemCtrl.</p>
  
  <p>I want to pass a variable to the ItemCtrl. I thought of using a service called SharedProperties :</p>
  
  <pre><code>service('sharedProperties', function () {
      var list_name = '';
  
      return {
          getListName: function() {
              return list_name;
          },
          setListName: function(name) {
              list_name = name;
          }
      };
  });
  </code></pre>
  
  <p>When the link is clicked, I call an angular click event to trigger the following function :</p>
  
  <pre><code>$scope.changeListName = function(name) {
      sharedProperties.setListName(name);
  };
  </code></pre>
  
  <p>However, the ng-click does not seem to change the value of my shared property...</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I put an alert inside the function triggered by ng-click and the alert is triggered, as it should be.</p>
  
  <p>However, when I write my function like this :</p>
  
  <pre><code>$scope.changeListName = function(name) {
      sharedProperties.setListName(name);
  };
  </code></pre>
  
  <p>It doesn't work... it looks like 'sharedProperties.setListName(name);' is not executed...</p>
  
  <p>If I put it outside the function with a dummy name (eg. metro), it works..</p>
  
  <p><strong>UPDATE 3</strong></p>
  
  <p>I tried multiple things and I am pretty confident that the problem is with this function :</p>
  
  <pre><code>$scope.changeListName = function(list_name) {
      sharedProperties.setListName(list_name);
  };
  </code></pre>
  
  <p>Do you have any idea why this is happening?</p>