问题
I use ng2-jalali-date-picker
and jalali-moment
in angular application.
my date picker work in local machine but i build and deploy application in server with this command : ng build --prod
my components that contain date picker not loaded and my page not rendered.
I get this errors only in server:
ERROR TypeError: Cannot read property 'gregorian' of undefined
ERROR TypeError: Cannot read property 'hideInputContainer' of undefined
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'format' of undefined
I not any idea for this errors.
回答1:
I had a similar issue with my angular app. I resolved it with this command, I hope it will work for you as well.
ng build --prod --aot=false --build-optimizer=false --no-progress
来源:https://stackoverflow.com/questions/53630358/angular-package-work-locally-but-not-work-after-deploy