Using momentjs plugins with Ionic 2

Hi,

I’m trying to use https://github.com/gf3/moment-range in my Ionic 2 app but I’m not sure how to include it. I have tried:

require('moment-range');

and

import * as range from 'moment-range';

and neither of these methods work. Could someone tell me how it can be achieved or is it not possible?

Thanks for any help.

Turns out it was very simple and all I need was:

import 'moment-range';

Typescript just isn’t happy with this:

Error TS2339: Property 'range' does not exist on type 'Moment'.

1 Like

Got some help on StackOverflow in the end and fixed the issue

1 Like