I get the following error when trying to add a descriptives array to my data and model. error TS2322: Type '{ "id": string; "name": string; "competency": string; "descriptives": string[]; "year": string; }[]' is not assignable to type 'Competency[]'. Type '{ "id": string; "name": string; "competency": string; "descriptives": string[]; "year": string; }' is not assignable to type 'Competency'. Types of property 'descriptives' are incompatible. Type 'string[]' is not assignable to type 'Descriptive[]'. Type 'string' is not assignable to type 'Descriptive'. app/app.routes.ts(9,36): error TS2307: Cannot find module './inventory/inventory.component'.
mocksCompetency.ts
import { Competency } from './competency';
export const COMPETENCY: Competency[] = [
{
"id": "EngLA001",
"name": "Oral Language",
"competency": "The teacher understands the importance of oral language, knows the development processes of oral language and provides the students with varied opportunities to develop listening and speaking skills.",
"descriptives": ["Something","More"],
"year": "2014",
}
];
competency.ts
export class Competency {
id: string;
name: string;
competency: string;
descriptives: Descriptive[];
year: string;
}
export class Descriptive {
description: string;
}