I'm having some trouble figuring out how to use an ng-if directive withing a specific property on an array of objects.
Array:
[{"Id":1087,
"CreateDate":"2015-11-02T19:26:39.007",
"Message":"Some text in here...",
"AffectedDate":null,
"Type":"a",
"CreatePeriod":"Today",
"CreateDateString":"Monday, November 2, 2015 7:26 PM"},
{"Id":1086,
"CreateDate":"2015-11-02T19:26:25.2",
"Message":"Some text in here...",
"AffectedDate":null,
"Type":"a",
"CreatePeriod":"Yesterday",
"CreateDateString":"Monday, November 2, 2015 7:26 PM"},
{"Id":1085,
"CreateDate":"2015-11-02T19:26:13.677",
"Message":"Some text in here...",
"AffectedDate":"2015-10-30T07:00:00",
"Type":"a",
"CreatePeriod":"Older",
"CreateDateString":"Monday, November 2, 2015 7:26 PM"}]
Above is the array of objects coming down and I'd like to use an ng-show directive on the following heading.
<h3 ng-show="">Last Week</h3>
The property I want to use with ng-show is CreatePeriod
Using the above HTML, since there is no object with CreatePeriod having "Last Week" I want to hide that heading.
Can this be achieved with a simple ng-show? Or do I need to use an ng-repeat in conjunction with the ng-show?
Thanks!
"CreatePeriod":"Last Week", is that right?