title: AngularJS Directives with Circular Dependency
body: <p>I have a circular directive dependency situation.</p>
  
  <pre><code>DirectiveA.template = '&lt;div switch-on="v"&gt; &lt;DirectiveB when="someVal" /&gt; &lt;/div&gt;';
  DirectiveB.template = '&lt;div&gt; &lt;DirectiveA /&gt; &lt;/div&gt;';
  </code></pre>
  
  <p>What this will do, if you set up this situation, is hang Chrome and eventually crash the page.</p>
  
  <p>I think the reason is because the way the $compile works it will cause endless recursion.</p>
  
  <p>However, as you can see based on my switch statement, there is a recursion terminator clause.  As soon as "someVal" is not equal to $scope.v it should end the recursion.</p>
  
  <p>So my question: is there any way to setup a circular dependency between 2 directives?</p>