I use Node.js 7.44.
In file user.models.ts, I have multiple classes, like:
import { Exclude, Expose } from "class-transformer";
export class User {
@Expose() _id: string;
@Expose() fname: string;
@Expose() lname: string;
@Expose() birthday: Date;
@Expose() address: Address;
constructor(){...}
}
@Exclude()
export class Address {
@Expose() street: string;
@Expose() num: number;
@Expose() city: string;
@Expose() zipCode: number;
}
When I compile the server, I get the error:
ReferenceError: Address is not defined
How can I use multiple classes in the same file?