title: error TS2345: Argument of type 'Menu' is not assignable to parameter of type
body: <p>Good day. I'm new to Type Script, using VSCode.</p>
  
  <p>Getting following <strong>errors</strong>:</p>
  
  <pre><code>error TS2345: Argument of type 'Menu' is not assignable to parameter of type '{ state: string; name: string; type: string; icon: string;
   badge?: undefined; children?: undefine...'
  </code></pre>
  
  <p>the <strong>code</strong>:</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  
  export interface BadgeItem {
    type: string;
    value: string;
  }
  
  export interface ChildrenItems {
    state: string;
    name: string;
    type?: string;
  }
  
  export interface Menu {
    state: string;
    name: string;
    type: string;
    icon: string;
    badge?: BadgeItem[];
    children?: ChildrenItems[];
  }
  
  const MENUITEMS = [
    {
      state: '/',
      name: 'HOME',
      type: 'link',
      icon: 'explore'
    },
    {
      state: 'account',
      name: 'ACCOUNT',
      type: 'sub',
      icon: 'explore',
      badge: [
        {type: 'purple', value: 'new'}
      ],
      children: [
          {state: 'users', name: 'USERS'},
      ]
    }
  ];
  
  @Injectable()
  export class MenuService {
    getAll(): Menu[] {
      return MENUITEMS;
    }
  
    add(menu: Menu) {
      MENUITEMS.push(menu);
    }
  }
  </code></pre>
  
  <p>Any help will be highly appreciated.</p>