title: Angular Object literal may only specify know properties and ... does not exist in type
body: <p>I'm starting out with Angular and running into an error.</p>
  
  <blockquote>
    <p>.../mocks.ts(9,4): Type '{"id": number; "name": string; "description": string; "inStock": number; "price": number; "featu...' is not assignable to type 'CarPart[].
    Object literal may only specify known properties, and '"featured"' does not exist in type 'CarPart'.</p>
  </blockquote>
  
  <p>My code:</p>
  
  <p>car-part.ts</p>
  
  <pre><code>export class CarPart {
      id: number;
      name: string;
      description: string;
      inStock: number;
      price: number;
      featured: boolean;
  }
  </code></pre>
  
  <p>mock.ts</p>
  
  <pre><code>import { CarPart } from './car-part';
  
  export const CARPARTS: CarPart[] = [{
      "id": 1,
      "name": "Super Tires",
      "description": "These tires are the very best",
      "inStock": 5,
      "price": 299.99,
      "featured": false //Line 9
    }, 
    {
      "id": 2,
      "name": "Reinforced Shocks",
      "description": "Shocks made of kryptonite",
      "inStock": 4,
      "price": 500.50,
      "featured": false
    },
    {
      "id": 3,
      "name": "Padded Seats",
      "description": "Super soft seats for a smooth ride",
      "inStock": 0,
      "price": 333.33,
      "featured": true
    }];
  </code></pre>
  
  <p>car-parts.component.ts</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { CarPart } from './car-part';
  import { CARPARTS } from './mock';
  
  @Component({
    selector: 'car-parts',
    templateUrl: './car-parts.component.html',
    styleUrls: ['./car-parts.component.css']
  })
  export class CarPartsComponent implements OnInit {
  
    constructor() { }
  
    carParts: CarPart[];
  
    totalCarParts(){
      let sum = 0;
  
      for(let carPart of this.carParts){
          sum += carPart.inStock;
      }
      return sum;
    }
  
    ngOnInit() {
      this.carParts = CARPARTS;
    }
  
  }
  </code></pre>
  
  <p>when I remove "featured" from both mock.ts and car-part.ts it is fine, no error. If I add it or any other name or type, it wont work...
  Can someone explain this?</p>