-
Notifications
You must be signed in to change notification settings - Fork 397
TypeError: Cannot read property 'utc' of undefined #104
Comments
Did you remember to include |
Yes I did. |
So, if you could create a plunkr/jsfiddle that reproduces the issue that would be great. Thanks! |
I have the same error in my app. I just change the order of includes and works fine! <script src="app/assets/js/moment-with-locales.js"></script> <script src="app/assets/js/angular-moment.min.js"></script> |
I'm having the same issue! in that order! |
i'm having the same problem, i'm including both moment.js and angular-moment The problem seems to be that angular couldn't inject moment and its undefined |
@EladBezalel Are you sure about the import order? |
Yes.. The order is fine.. |
I figured out it was a problem with moment problem because its not working properly with node webkit. |
Same problem here. I use JSPM/SystemJS for package management/module loading.
which forces to load moment via global
|
My temporary solution is to install moment from npm and define it global: var moment = require('moment'); |
Thanks for everyone who participated. This is now fixed and released as 0.10.1 |
Just in case this helps someone else. < script src="moment/moment.js" > before angular.js (not just before angular moment). |
Thanks @nikolai-b your tip fixed my issue. @urish This issue needs to be re-opened. |
I had the same issue with nw.js (node-webkit). This was solved updating angular-moment to 0.10.1 and moment to 2.10.3. Thanks! |
having same issue here. using moment.js 2.10.3 I added angularjs moment to my app.js and attached the angularMomentConfig
regarding order, i have tried following orders (and others): jquery.js jquery.js jquery.js and some more - same error all the time.
using it in my template and created at is a timestamp 1400054171:
|
@nikolai-b Thanks. i put moment.js before Angular and works like a charm. |
I solve my problem with this versions
|
I solved mine loading also the localization files bower_components/momentjs/min/moment-with-langs.min.js |
I have just added angular-moment in my angularjs project and Im getting the error "TypeError: Cannot read property 'utc' of undefined"
In the following link I found out that the only option is to downgrade the momnetjs version:
http://stackoverflow.com/questions/26642479/angular-moment-cannot-read-property-utc-of-undefined
"Apparently, since v2.4 moment is not a global object any more, which resulted in 'undefined' everytime angular-moment made a reference to moment.
I switch to v.2.3.1, it works like a charm now"
The text was updated successfully, but these errors were encountered: