【发布时间】:2016-02-21 22:25:52
【问题描述】:
所以如果我的 JSON 数组对象返回这个:
"Tools": [
{
"name": "Submit a Claim",
"position": 1,
"isOn": true,
"alert": null
},
{
"name": "My Recurring Claims",
"position": 2,
"isOn": true,
"alert": null
},
{
"name": "Online Enrollment",
"position": 3,
"isOn": false,
"alert": "Online enrollment is available for the upcoming plan year. Click here to enroll!"
},
我的 ng-show html 有这个:
<div class="toolTile col-md-3" ng-show="Tools.name = 'Online Enrollment' && Tools.isOn==true ">
<a href="#/claimEnter">
<img class="toolIcon" src="ppt/assets/toolIcons/oe.svg">
<p>Online Enrollment</p>
</a>
</div>
<div class="toolTile col-md-3" ng-show="Tools.name = 'Submit a Claim' && Tools.isOn==true ">
<a ng-click="transId()" ng-href="{{ ppt.Globals.hasDebitCard ? '#/claimEnter' : '#/claimSub' }}" >
<img src="ppt/assets/toolIcons/submitclaim.svg" >
<p>Submit a Claim</p>
</a>
</div>
为什么它一直评估为假?我尝试了很多变体,“在线注册”应该隐藏,而“提交索赔”应该显示。
关于我在这里可能做错了什么的任何想法?
非常感谢。
【问题讨论】:
-
忘记了
==?在Tools.name = 'Submit a Claim'
标签: html arrays angularjs json