javascript - Angular 矩类型错误 : momentValue. toISOString 不是函数

标签 javascript angularjs meteor angular-meteor angular-moment

使用 Angular 矩 meteor 包出现以下错误

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

知道为什么会发生这种情况吗?

最佳答案

这里提供的杰森自己的答案对我有用,只是它不是 ...:angular-meteor 它是

meteor add jasonaibrahim:angular-moment

第一次做之后

meteor remove tonekk:angular-moment

关于javascript - Angular 矩类型错误 : momentValue. toISOString 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31443156/

相关文章:

javascript - 我如何使用 jQuery 解析 xml?

javascript - 使用 $attrs 评估其中带有花括号的属性

android - Android 应用程序 Meteor 后端的 OpeningHandshakeException

javascript - window.location.hash 不起作用?

javascript - 如何从一个 HTML 表格拖放到另一个表格?

javascript - 如何使用页面上所有图像的图像 src 填充 alt 字段

json - 如何将 Angular 中的单个 json 数据 "values"绑定(bind)到命名 $scope 变量(使用 SPARQL 查询返回的数据)?

angularjs - 未调用链接函数

javascript - 将 meteor 启动脚本安装到主目录

meteor - Meteor 和 Iron Router 的产量有事件 Hook 吗?模板.产量.渲染?