While I have no trouble using moment.JS and its methods, I'm currently facing an issue with setting the attribute in my class to be of type Moment
, much like how we would set it as a type string
or type boolean
.
For example:
export class Event {
checkin_datetime: Moment;
}
However, when attempting this, TypeScript throws an error stating "cannot find name 'Moment'". It's strange because I am able to use all moment
methods without any problem, except for setting the attribute as a Moment
.
I have already included
import * as moment from 'moment';
at the top of my class.