title: Comparing two arrays inside ng-if
body: <p>I have array inside a class, and I have to compare if the arrays are same in 2 different objects of the same class. Currently, I am doing it like this,</p>
  
  <pre><code>&lt;div class="col-md-4"&gt;{{ctrl.Obj1.arr1}}
    &lt;span ng-if="ctrl.Obj2 != null &amp;&amp; ctrl.Obj1.arr1 != ctrl.Obj2.arr1"
        class="glyphicon glyphicon-alert" style="margin-left: 6px;
       font-size: small; color: palevioletred"&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But this is an incorrect way of comparison since it yields different values. My array is of the form: <code>["string1","string2","string3"]</code></p>
  
  <p>What's the correct way to do it?</p>
  
  <p>Edit: My question is different because I am asking about how to accomplish this in AngularJS. </p>