我使用的是NG重复块内的NG-显示指令有一个问题。
布尔值似乎并没有被获得通过正确NG-节目...
为了说明我的意思,这里是我的jsfiddle做出了表率的截图:
下面是一些例子标记:
<table ng-controller="ActressController" class="table table-bordered table-striped">
<tr ng-repeat="actress in actressList">
<td>
<span class="actress-name">{{ actress.name }}</span>
<h4 ng-show="{ actress.name == 'Scarlett' }">Was in Avengers! <span class="note">(should only appear if Scarlett)</span></h4>
<h2>{{ actress.name == 'Scarlett'}} <span class="note"><-- this statement is correct</span></h2>
</td>
</tr>
</table>
下面是一个例子的控制器:
function ActressController($scope) {
$scope.actressList = [
{
name: "Angelina"
}, {
name: "Scarlett"
}, {
name: 'Mila'
}, {
name: 'Megan'
}
]
}
什么我可能做错了任何想法?