title: How to watch for change in one particular nested array item attribute in Angular JS?
body: <p>I have an array that looks like this:</p>
  
  <pre><code>$rootScope.array = [{
  
                      "id":"a",
                      "title":"a",
                      "options":[
                                  {
                                    "optId":"abc",
                                    "isInvalid":false
                                  },
                                  {
                                    "optId":"efg",
                                    "isInvalid":false
                                  }
                                ]
                    },
                    {
                      "id":"b",
                      "title":"b",
                      "options":[
                                  {
                                    "optId":"hij",
                                    "isInvalid":false
                                  },
                                  {
                                    "optId":"lmn",
                                    "isInvalid":false
                                  }
                                ]
                    }];
  </code></pre>
  
  <p>On any change to the '<code>isInvalid</code>' attribute inside '<code>options</code>', I want to trigger a function that would evaluate the entire array and set some properties to '<code>true</code>' and some to '<code>false</code>'.</p>
  
  <p>I understand something of this sort can be done using deep $watch object equivalence, but I am not sure as to how exactly I can watch only for change in the '<code>isInvalid</code>' and not change in lets say '<code>optId</code>'. </p>
  
  <p>In the bigger scheme of things, my intent is to validate the entire array by a set of business rules. So, if the "<code>isInvalid</code>" attribute of the first object changes to '<code>true</code>', I want to make sure that the '<code>isInvalid</code>' of the second object is set to '<code>false</code>' and so on. </p>
  
  <p>So if there is a better way to do this other than <code>$watch</code>, I am all ears, because I'm relatively new to Angular and I'm a little lost!</p>