title: Not retaining $scope when using directive inside controller scope
body: <p>In my code I have two directives. One is inside the controller scope and the other is not in the <code>html</code> part.</p>
  
  <pre><code>  &lt;div ng-show="isStore==true"&gt;
                  &lt;packgroup-directive&gt;
                  &lt;/packgroup-directive&gt;
                  &lt;div class="lineBreaker" ng-if="groupList.length&gt;0"&gt;&lt;/div&gt;
                   &lt;div ng-controller="WalletController"&gt;
                     &lt;outfit-directive&gt;&lt;/outfit-directive&gt;
                     &lt;div class="imageContainer" ng-show="getPurchaseState() == false" ng-click="buyAllOutfit()"&gt;
                          &lt;img class="feature1" ng-src="/app/app_resources/language/en/resources/{{buyAllOutfitBanner}}"/&gt;
                          &lt;div class="buttonBanner"&gt;{{allOutfitBannerValue}}
                          &lt;img style="width: 20%" ng-src="/app/app_resources/icons/pep_sign_black.png"&gt;&lt;/div&gt;
                      &lt;/div&gt;
                   &lt;/div&gt;
  </code></pre>
  
  <p>Here <code>packgroup-directive</code> is not having the controller tag outside and the <code>outfit-directive</code> is inside the <code>WalletController</code> tag.</p>
  
  <p>So the problem I am facing is that I am having a variable <code>popupopen</code> which controls the closing of the popup. In my controller I call this function from another JS file  : </p>
  
  <pre><code>$scope.checkPopup = function(){
        if(popupOpen==1 &amp;&amp; dialogID!=null){
          ngDialog.close(dialogID);
          ngDialog.close($scope.dialogID);
          bridge.getPopupState("0");
        }
      }
  </code></pre>
  
  <p>This function is called from other JS file but the updated value is only shown for the <code>packgroup directive</code> but not for the <code>outfit-directive</code>, but when I remove it from the <code>WalletController</code> tag it displays the correct value. </p>
  
  <p>Code : <a href="https://jsfiddle.net/x1x1ug5y/" rel="nofollow noreferrer">https://jsfiddle.net/x1x1ug5y/</a></p>