title: Filter array of objects remove duplicates by property [AngularJS]
body: <p>I have <code>$scope.notys</code>  array  in my controller and <code>ng-repeat</code>:</p>
  
  <pre><code>&lt;li ng-repeat="x in notys" class="item js-item"&gt;
  ...
  </code></pre>
  
  <p>From my controller I push data into array like this:</p>
  
  <p><code>$scope.notys.push(data);</code></p>
  
  <p>Every <code>data</code> have uniques id property <code>data.id</code></p>
  
  <p>Question is how can I update/replace object where property is same with last <code>data.id</code> which comes from ajax?</p>
  
  <p>So I need to do something like this:</p>
  
  <ol>
  <li><p>Get <code>data</code> from ajax</p></li>
  <li><p>Now have <code>data.id</code> from ajax I need to check if in <code>$scope.notys</code> exists object with same <code>data.id</code></p></li>
  <li><p>If exists then replace it with last data, if not then just <code>push</code> data</p></li>
  </ol>