angular-moment TypeError:momentValue.toISOString不是函数

时间:2015-07-15 23:50:40

标签: javascript angularjs meteor angular-meteor angular-moment

使用角度矩流星包

获得以下错误
angular.js:12332 TypeError: momentValue.toISOString is not a function
    at updateMoment (angular-moment.js:199)
    at Object.fn (angular-moment.js:215)
    at Scope.$get.Scope.$digest (angular.js:15685)
    at Scope.$get.Scope.$apply (angular.js:15953)
    at angular-meteor-meteorCollection.js:160
    at angular.js:17711
    at completeOutstandingRequest (angular.js:5396)
    at angular.js:5668

我在一个地方使用amTimeAgo指令:

<li class="hidden-xs"><p class="text-muted text-sm" am-time-ago="obj.createdAt"></p></li>

这是我的包文件:

# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-platform
accounts-ui
accounts-password
fourseven:scss
urigo:angular@=0.9.2
angular:angular
angularui:angular-ui-router
angular:angular-material
angular:angular-mocks
angular:angular-animate
angular:angular-touch
angular:angular-sanitize
angular:angular-cookies
angular:angular-server
tonekk:angular-moment

我的版本文件:

accounts-base@1.2.0
accounts-password@1.1.1
accounts-ui@1.1.5
accounts-ui-unstyled@1.1.7
angular:angular@1.4.2
angular:angular-animate@1.4.2
angular:angular-aria@1.4.2
angular:angular-cookies@1.4.2
angular:angular-material@0.10.0
angular:angular-mocks@1.4.2
angular:angular-sanitize@1.4.2
angular:angular-server@1.4.0
angular:angular-touch@1.4.2
angularui:angular-ui-router@0.2.15
autoupdate@1.2.1
base64@1.0.3
binary-heap@1.0.3
blaze@2.1.2
blaze-tools@1.0.3
boilerplate-generator@1.0.3
callback-hook@1.0.3
check@1.0.5
dburles:mongo-collection-instances@0.3.4
ddp@1.1.0
deps@1.0.7
ejson@1.0.6
email@1.0.6
fastclick@1.0.3
fourseven:scss@3.2.0
geojson-utils@1.0.3
html-tools@1.0.4
htmljs@1.0.4
http@1.1.0
id-map@1.0.3
jquery@1.11.3_2
json@1.0.3
lai:collection-extensions@0.1.4
launch-screen@1.0.2
less@1.0.14
livedata@1.0.13
localstorage@1.0.3
logging@1.0.7
meteor@1.1.6
meteor-platform@1.2.2
minifiers@1.1.5
minimongo@1.0.8
mobile-status-bar@1.0.3
mongo@1.1.0
mrt:moment@1.7.0
npm-bcrypt@0.7.8_2
observe-sequence@1.0.6
ordered-dict@1.0.3
random@1.0.3
reactive-dict@1.1.0
reactive-var@1.0.5
reload@1.1.3
retry@1.0.3
routepolicy@1.0.5
service-configuration@1.0.4
session@1.1.0
sha@1.0.3
spacebars@1.0.6
spacebars-compiler@1.0.6
srp@1.0.3
templating@1.1.1
tonekk:angular-moment@1.0.2
tracker@1.0.7
ui@1.0.6
underscore@1.0.3
urigo:angular@0.9.2
url@1.0.4
webapp@1.2.0
webapp-hashing@1.0.3

知道为什么会这样吗?

2 个答案:

答案 0 :(得分:1)

杰森在这里提供的答案对我有用,除非...:angular-meteor不是

meteor add jasonaibrahim:angular-moment

首先做

之后
meteor remove tonekk:angular-moment

答案 1 :(得分:0)

原来我使用的流星包(tonekk:angular-moment)正在使用过时的角度矩。

我通过使用最新版本的角度流星创建我自己的流星包来解决这个问题。

meteor add jasonaibrahim:angular-moment

相关问题