title: Watch variable and change it
body: <p>In AngularJS I have a directive that watches a scope variable. When the variable contains certain data then I need to alter that variable a bit. The problem is that when I change the variable that my <code>$watch</code> is triggered again. So I end up in a continuous loop.</p>
  
  <pre><code>scope.$watch('someVar', function(newValue, oldValue) {
      console.log(newValue);
      scope.someVar = [Do something with someVar];
  });
  </code></pre>
  
  <p>This keeps triggering <code>$watch</code> again, which makes sense. But I do need a way to change the watched variable. Is there a way to do this?</p>