【发布时间】:2018-06-21 11:13:28
【问题描述】:
我正在尝试将 moment-range 包导入到我的 Angular 4.x 应用程序中,官方文档显示了这一点:-
import Moment from 'moment';
import { extendMoment } from 'moment-range';
const moment = extendMoment(Moment);
但是在我的应用程序中,已经通过以下方法添加了时刻:
import * as Moment from 'moment';
所以我决定使用相同的方法来尝试让矩范围工作
import * as Moment from 'moment';
import * as MomentRange from 'moment-range';
const moment = MomentRange(Moment);
但是我收到以下打字稿错误 - 谁能建议我如何解决这个问题?
Cannot invoke an expression whose type lacks a call signature.
Type 'typeof "/node_modules/moment-range/dist/moment-range"'
has no compatible call signatures.
【问题讨论】:
标签: javascript angular typescript momentjs