code: function sync(collection, newCollection, index) {
          if (index === void 0) { index = 'id'; }
          var answer = removeElements(collection, newCollection, index);
          if (newCollection) {
              newCollection.forEach(function (item) {
                  var oldItem = _.find(collection, function (c) { return c[index] === item[index]; });
                  if (!oldItem) {
                      answer = true;
                      collection.push(item);
                  }
                  else {
                      if (item !== oldItem) {
                          angular.copy(item, oldItem);
                          answer = true;
                      }
                  }
              });
          }
          return answer;
      }
docs: Changes the existing collection to match the new collection to avoid re-assigning
  the array pointer, returns true if the array size has changed