title: Angular deep compare objects except for specific properties
body: <p>Use case:</p>
  
  <pre><code>$scope.$watch('settings', function (newVal, oldVal) {
     if (!angular.equals(oldVal, newVal)) {
         setDirty();
      }
  }, true);
  </code></pre>
  
  <p>Now this is practically the same as</p>
  
  <pre><code>$scope.$watch('settings', function (newVal, oldVal) {
     if (oldVal) {
         setDirty();
      }
  }, true);
  </code></pre>
  
  <p>Since the <code>$watch</code> already compares the two.</p>
  
  <p>However, there is one property that even though it changes i don't want to <code>setDirty()</code>.</p>
  
  <p>This is my working (hacky) solution so far:</p>
  
  <pre><code>$scope.$watch('settings', function (newVal, oldVal) {
     if (!oldVal) return;
     var editedOldVal = angular.copy(oldVal, {});
     var editedNewVal = angular.copy(newVal, {});
     delete editedOldVal.propertyIDontWannaWatch;
     delete editedNewVal.propertyIDontWannaWatch;
     if (!angular.equals(editedOldVal, editedNewVal)) {
         setDirty();
     }
  }, true);
  </code></pre>
  
  <p>Is there a cleaner way to make <code>angular.equals()</code> or the <code>$watch</code> ignore specific properties?</p>
  
  <p>EDIT:</p>
  
  <p><a href="https://stackoverflow.com/a/26144401/4341456">This answer</a> does not solve my problem since<br/> <code>option 1</code> is not a solution at all, says that if the property that i don't want to watch hasn't changed - do nothing, but this is exactly the property i want to ignore (don't care if it changed or not). <br/><code>option 2</code> makes that property not comparable at all, i only want to ignore it on this specific case and not make it uncomparable by definition.</p>