title: How to execute ng-if before a directive or use something else than ng-if?
body: <p>My problem here is that the directive gets executed before the ng-if. <br/>
  How can i manage to execute the ng-if before the directive? </p>
  
  <p>Am i doing something wrong ? Should i use something else than ng-if to show/hide divs?</p>
  
  <p><a href="http://plnkr.co/edit/Q2wdSnTJHVQbD3fK3O8N?p=preview" rel="nofollow">http://plnkr.co/edit/Q2wdSnTJHVQbD3fK3O8N?p=preview</a><br/><br/>
  script.js</p>
  
  <pre><code>lolModule = angular.module('lolModule',[]);
  lolModule.directive('initTest', function(){
      return function($scope, $element){
          console.log("test",$element.html());
      };
  });
  
  lolModule.controller("ctrl",function($scope){
    $scope.testExpr=function(e){
      console.log("bool=",e);
      return e;
    }
  });
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html data-ng-app="lolModule"&gt;
  
    &lt;head&gt;
      &lt;script src="https://code.angularjs.org/1.3.0-beta.5/angular.js"&gt;&lt;/script&gt;
      &lt;script src="script.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body data-ng-controller="ctrl"&gt;
      &lt;div init-Test&gt;
        &lt;div ng-if="testExpr('true')"&gt;if is true&lt;/div&gt;
        &lt;div ng-if="testExpr('false')"&gt;if is true&lt;/div&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>