Wondering if it's possible to declare an object inside my model. First attempt:
export class Employee{
emp_id: number;
emp_fname: string;
emp_lname: string;
emp_birth: string;
emp_status: string;
emp_photo: string;
emp_department: string;
department: Array<object> =
[{
dept_id: number;
dept_name: string;
}];
Second attempt:
import { Department } from "./department.model";
export class Employee{
constructor(department: Department){};
emp_id: number;
emp_fname: string;
emp_lname: string;
emp_birth: string;
emp_status: string;
emp_photo: string;
emp_department: string;
department: department;
}
Encountering errors in my terminal: first one gives syntax error for missing comma or incorrect number type.
The second one throws an error
Cannot find name 'department'.
Here is my department model
export class Department {
dept_id: number;
dept_name: string;
}