Currently, I am developing a web application using AngularJS and there are times when I need to verify if the element inside the ng-if or ng-show directive belongs to a specific list. The approach I am using right now is shown below:
<div ng-if="object.element=='A' || object.element=='B' || object.element=='C'">
<p>Hello World!</p>
</div>
However, I am curious to know if there is a more concise way to achieve the same result like this:
<div ng-if="object.element in ['A','B','C']">
<p>Hello World!</p>
</div>