title: in angular js how to call a function if ng-if is true?
body: <p>i am totally new with angular js and trying to call a function when ng-if is true
  my code =></p>
  
  <pre><code>ng-repeat="image in post.postImages" ng-if="$index &lt;= 3" ng-init="image.showDeleteIcon= false &amp;&amp; hellow()"
  </code></pre>
  
  <p>and my js =></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
         $scope.hellow = function ()
         {
             alert('hi');
         };
  &lt;/script&gt;
  </code></pre>
  
  <p>also try=></p>
  
  <pre><code>&lt;span ng-if="$index === 3" ng-init="hellow()"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>problem is it is not alerting anything ?can anybody tell me what i have done wrong?</p>