How to use moment-duration-format in TypeScript?

前端 未结 4 1217
忘掉有多难
忘掉有多难 2021-02-19 06:00

I am using moment.js in my TypeScript (Ionic2/Angular2) project. Following on from this post, I now want to try out a plugin moment-duration-format

I have the npm packag

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-19 06:26

    The problem is as R_B_ correctly worked out a wrong type definition in the typings module for moment-duration-format.

    I'll create a new pull request for this, as my last was closed because of lint errors.

    So long you can use a custom type definition in your project as done here https://github.com/TwoStone/leaderboard/blob/develop/subprojects/webapp/src/custom-typings.d.ts Just create the file in your project and it should work for the moment.

提交回复
热议问题