ng-repeat忽略立即ng-if

und*_*ned 7 javascript angularjs ng-repeat

我已经和Angular JS合作了很长时间,但刚刚面临一个奇怪的问题,ng-if只是被忽略了ng-repeat.

这是示例和简单代码,它不能按预期工作

<ul ng-repeat="detail in details">
  <span ng-if="2 == 3"> <!-- This should block the next tags to execute-->
    <li>{{detail.name}}
      <ul ng-repeat="detailed in details.name">
        <li>{{detailed.prof}}</li>
      </ul>
    </li>
  </span>
  <span ng-if="2 === 2"> <!-- Instead this should get print -->
    Print this (Updated)
  </span>
</ul>
Run Code Online (Sandbox Code Playgroud)

这是我的plunkr:https://plnkr.co/edit/xy4Qyd4tXm6kWROiaFVR p = preview

Gur*_*ngh 3

使用这个版本

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
Run Code Online (Sandbox Code Playgroud)

或使用ng-if->ng-show