Closed rzkhosroshahi closed 5 years ago
Hi, thanks :), sorry for delay I found some solutions in the following link https://github.com/jvandemo/generator-angular2-library/issues/221
import * as moment_ from 'moment';
const moment = moment_;
good luck
hi
i have same problem too, i use jalali-moment in angular library . but when i want build my library , i get
can't call moment namespace
i import *import as moment from 'jalali-moment';* in my component . i read your tips . but I can't understand exactly what you mean . Do I need to delete my import `import as moment from 'jalali-moment'; and add instead of
import * as moment from 'moment'; const moment = moment;` ? or add just your tips in my component ?
please follow the link and do the same for 'jalali-moment', because jalali-moment is a kind of plugin for moment.js.
thank you . my problem is solved. i replaced import * as moment_ from 'jalali-moment';
with import * as moment_ from 'jalali-moment'; const moment = moment_;
Describe the bug Hi, khaste nabashi :) I faced an issue when I run my tests. the error is:
TypeError: jalali_moment_1.default is not a function
. this error solved when I use jalali-moment in typescript usage as you said in docs. but in this situation, I got another error in rollup that saidcan't call moment namespace
:( in simple usage I haven't any error and issue except this error in the test env. you can see my project here.Desktop (please complete the following information):