Using moment.js in Angular 2 typescript application

后端 未结 5 2126
名媛妹妹
名媛妹妹 2021-02-20 06:21

I\'m struggling in using moment.js library inside an Angular 2 Typescript app. Even after reading the answer to this question I can\'t get it to work.

This is what I did

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-20 07:12

    import * as moment_ from 'moment';
    const moment:moment.MomentStatic = (moment_)['default'] || moment_;
    

提交回复
热议问题