title: Angular 7 PATCH method to add element to a list
body: <p>How should I write the PATCH method that allows me to add and remove items of an array inside an array?</p>
  
  <p>ItemClass:</p>
  
  <pre><code>export class ItemClass {
  constructor(public person: string, public name: string, public quantity: number, public price: number){}
  }
  </code></pre>
  
  <p>MenuModel:</p>
  
  <pre><code>    import { ItemClass } from './item.model';
  
      export class MenuModel {
  
  
      id: number;
      name: string;
      items: ItemClass[];
  
      constructor( id: number,  name: string, items: ItemClass[]){
  
           this.id = id;
           this.name = name;
           this.items = items;
      }
  }
  </code></pre>
  
  <p>I have a menu component and a menu service. I need a patch method that adds elements to the ItemClass[] array inside Menu and is able to remove them as well.</p>
  
  <p>The API method looks like : </p>
  
  <pre><code>   @PATCH
     @Path("/add/{menuId}")
     public void removeMenuItem(
              @PathParam("menuId") final int menuId,
              final Item item) {  // Item represents the Request Body
        final List&lt;Item&gt; items = this.menuRepository.get(menuId).getItems();
        items.add(item);
     }
  </code></pre>
  
  <p>(from <a href="https://stackoverflow.com/a/54679303/479251">https://stackoverflow.com/a/54679303/479251</a>)</p>