I am displaying a json in a table, like so:
<tr ng-repeat="room in allRooms | orderBy: 'OpenTime'">
Where allRooms contains json objects like this:
{
"Name": "Room five",
"OpenTime": "2016-02-19 00:00:00",
"Entries": 2,
"Capacity": 10,
"Type": "TypeThree"
}
And the the Type property can be one of Five different values ("typeOne", "typeTwo", "TypeThree" etc.)
I want to use an ng-if to display a button in a column, only if Type is not "typeOne" or "typeTwo", e.g.:
<button type="button" ng-if="room.Type != 'typeOne' || room.Type != 'typeTwo'"></button>
This isn't working for me, although it is what I need.
But, this (although it doesn't achieve what I need) does work:
<button type="button" ng-if="room.Type == 'typeOne' || room.Type == 'typeTwo'"></button>
So I'm wondering why the second ng-if works as it should, but the first one doesn't, when the only difference between the two is the use of the equal to or not equal to operators?