我正在尝试将矩量程包导入到我的角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.发布于 2018-06-21 11:27:30
在github上发现了这个,它对我有用--希望它能帮助其他人
import * as moment from 'moment';
import { extendMoment } from 'moment-range';
const { range } = extendMoment(moment);
const timeRange = range(moment.utc([2015, 0, 1]), moment.utc([2015, 5, 1]));https://stackoverflow.com/questions/50967132
复制相似问题