title: Property "employee "does not exist on type "Department"
body: <p>I am making a beginner website and everything was good so far but I have a strange problem now. </p>
  
  <p>When type ng serve --open in the node.js console to start the site on the localhost
  I receive this message -></p>
  
  <blockquote>
    <p>ERROR in src/app/department-detail/department-detail.component.ts(59,32): error TS2339: Property 'employee' does not exist on type 'Department'</p>
  </blockquote>
  
  <p>My code is that: </p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { ActivatedRoute } from '@angular/router';
  import { Location } from '@angular/common';
  import { Department } from '../department';
  
  import { DepartmentService }  from '../department.service';
  
  import { Employee } from '../employee';
  import { EmployeeService }  from '../employee.service';
  @Component({
    selector: 'app-department-detail',
    templateUrl: './department-detail.component.html',
    styleUrls: ['./department-detail.component.css']
  })
  export class DepartmentDetailComponent implements OnInit {
  
    department : Department ;
    employees: Employee[];
    emp: Employee;
    average:number=1;
  
  
    constructor(private route: ActivatedRoute, private departmentService: DepartmentService, private location: Location,private employeeService: EmployeeService) { }
  
    ngOnInit() {
      this.getDepartment();
  
      this.getEmployees();
    }
    getDepartment(): void{
      const id = +this.route.snapshot.paramMap.get('id');
      this.departmentService.getDepartment(id).subscribe(department =&gt; this.department = department)
    }
  
    goBack(): void{
      this.location.back();
    }
    save(): void {
     this.departmentService.updateDepartment(this.department);
     this.goBack();
   }
  
   getEmployees(): void {
     this.employeeService.getEmployees().
     subscribe(employees =&gt; this.employees = employees);
   }
  
   Select(firstname:string){
     firstname = firstname.trim();
     if(!firstname){return;}
     this.employeeService.getEmployeeByName(firstname).subscribe(Employee =&gt; this.emp = Employee);
   }
  
   Delete():void{
     this.emp = null;
     this.average = 1;
   }
   Show():void{
     this.Select(this.department.employee); // this cant be true
     this.average = null;
   }
  
  
  }
  </code></pre>
  
  <p>The problem is in the last </p>
  
  <blockquote>
    <p>Show function</p>
  </blockquote>
  
  <p>If I delete employee and save and then add it again the side works but otherwise it does not.</p>
  
  <blockquote>
    <p>This is my department component.</p>
  </blockquote>
  
  <pre><code>export class Department{
      id: number;
      name: string;
      location: string;
      menId: number;
      static Id:number = 1;
  
      constructor(name: string,location: string) {
          this.id = Department.Id++;
          this.name = name;
          this.location = location;
          this.menId = 0;
  
      }
  
  }
  </code></pre>
  
  <p>I am not sure whether I should add a property of type Employee in the Department component.</p>