title: Scoping issue when setting ngModel from a directive
body: <p>I have a directive which looks something like:</p>
  
  <pre><code>var myApp = angular.module('myApp',[])
      .directive("test", function() {
        return {
          template: '&lt;button ng-click="setValue()"&gt;Set value&lt;/button&gt;',
          require: 'ngModel',
          link: function(scope, iElement, iAttrs, ngModel) {
            scope.setValue = function(){
              ngModel.$setViewValue(iAttrs.setTo);
            }
          }
        };
      });
  </code></pre>
  
  <p>The problem is that if I use this directive multiple times in a page then <code>setValue</code> only gets called on the last declared directive. The obvious solution is to isolate the scope using <code>scope: {}</code> but then the ngModel isn't accessible outside the directive.
  ​</p>
  
  <p>Here is a JSFiddle of my code: <a href="http://jsfiddle.net/kMybm/3/" rel="nofollow">http://jsfiddle.net/kMybm/3/</a></p>