gpt4 book ai didi

javascript - ng-repeat 忽略立即 ng-if

转载 作者:数据小太阳 更新时间:2023-10-29 04:39:53 25 4
gpt4 key购买 nike

我已经使用 Angular JS 很长时间了,但现在遇到了一个奇怪的问题,即 ng-ifng-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>

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

最佳答案

使用这个版本

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>

或者使用ng-if -> ng-show

关于javascript - ng-repeat 忽略立即 ng-if,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41562214/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com