I am familiar with using ng-show and ng-hide when my anchor data contains a specific word or piece of text. For instance:
<div ng-show="myArray.Length > 20">
Show something
</div>
<div ng-show="myData.Name == 'Harry Roberts'">
Show something
</div>
However, how can I use ng-showto display when the associated data contains a specific value, such as "Current". For example, if my data is JSON:
{
"MyAddresses": [
{
"Entry" : "1",
"Period" : "2011 - current",
}, {
"Entry" : "2",
"Period" : "2003 - 2011",
}, {
"Entry" : "3",
"Period" : "1998 - 2001",
}
]
}
<div ng-show="myData.MyAddresses.Period ~ 'Current'">
Show something
</div>
source
share