title: How to get two way data binding in a directive *without* an isolate scope?
body: <p>Using <code>scope: { ... }</code> in a directive introduces an isolate scope, which does not prototypically inherit from its parent scope. But I have always used it for a different reason: a convenient way to declare HTML attributes with two way data binding:</p>
  
  <pre><code>scope: {
      attr1: '=',
      attr2: '?='
  }
  </code></pre>
  
  <p>To get a non-isolate scope, you have to use <code>scope: true</code>, which does not offer the opportunity to declare such attributes. I now find myself needing a directive with a non-isolate scope, but with two way binding. What's the best way to achieve this?</p>
  
  <hr>
  
  <p><strong>Example:</strong> My use-case is something like this, in the view of the <code>outer-directive</code>:</p>
  
  <pre><code>&lt;div ng-repeat="e in element"&gt;
      &lt;inner-directive two-way-attr="e.value"&gt;&lt;/inner-directive&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But <code>inner-directive</code> is in the same module as <code>outer-directive</code>. It doesn't need to be encapsulated with an isolate scope. In fact, <strong>I need to use <code>$scope</code> inheritance for other purposes, so an isolate scope is not an option</strong>. It's just that using an HTML attribute to establish this two-way communication is extremely convenient.</p>