I am working with a file named mock-values.ts
. In this file, I have defined the following constants:
export const TIMES: Time[] = [
{ i: '8:00', v: '8' }, { i: '8:30', v: '8:30' },
{ i: '9:00', v: '9' }, { i: '9:30', v: '9:30' },
{ i: '10:00', v: '10' }, { i: '10:30', v: '10:30' },
{ i: '11:00', v: '11' }
];
export const MINUTES: Minute[] = [
{ half_hour: '30' },
{ half_hour: '60' },
{ half_hour: '90' }
];
When I try to run ng serve, I encounter the following error message
ERROR in src/app/meeting-form/mock-values.ts(1,21): error TS2304: Cannot find name 'Time'.
src/app/meeting-form/mock-values.ts(13,23): error TS2304: Cannot find name 'Minute'.
In my form.component.ts
, I import these values like this:
import { TIMES, MINUTES } from './mock-values';
times = TIMES;
minutes = MINUTES;
It takes about a minute for the compilation to succeed. Is there any way to optimize this process or ease the burden on the compiler?