Currently utilizing TypeScript version 2.5.3
along with Angular 5
.
I have an enum
defined in a separate file as follows:
export enum eUserType {
Driver = 1,
Passenger = 2,
User = 3
}
To import and use it in another ts
file, I do the following:
import { eUserType } from '../CorrectFilePath/eUserType';
export class ViewsModule {
newVariable=eUserType.Driver;
}
Although intellisense functions properly, I encounter a run-time error:
Cannot read property 'Driver' of undefined
.Am I misusing the
enum
or is there something else going wrong?
Update:
It's worth mentioning that The module in question is lazy loaded and utilizes a PreloadingStrategy
class (defined in a different file), where my enum
is also referenced within the PreloadingStrategy
class.