【问题标题】:Do I need momentJS if I'm using moment-with-locales?如果我使用的是带有语言环境的时刻,我需要 momentJS 吗?
【发布时间】:2017-12-07 05:42:45
【问题描述】:

现在我正在按以下顺序在我的项目中添加脚本:

window.top.ak.getScript([
    window.top.akContextPath + "/scripts/css/xxx.css",
    window.top.akContextPath + "/scripts/js/xxx.min.js",
    window.top.akContextPath + "/scripts/js/polyfills.min.js",
    window.top.akContextPath + "/scripts/js/jquery.min.js",
    currHost + "/components/lib/lodash.min.js",
    window.top.akContextPath + "/scripts/js/moment.min.js",
    window.top.akContextPath + "/scripts/js/angular.min.js"
], function() {
    window.top.ak.getScript([
        window.top.akContextPath + "/scripts/js/angular-messages.js",
        window.top.akContextPath + "/scripts/js/angular-ui-router.js",
        window.top.akContextPath + "/scripts/js/angular-animate.js",
        currHost + "/components/lib/toaster.min.js",
        window.top.akContextPath + "/scripts/js/ui-grid.min.js",
        currHost + "/components/lib/defiant.min.js",
        window.top.akContextPath + "/scripts/js/xxx-ui.js",
        currHost + "/components/lib/polyfill-resize.js",
        currHost + "/components/lib/draggable-rows.js",
        currHost + "/components/lib/moment-with-locales.js",
    ], function() {
        window.top.ak.getAsset([
            currHost + "/components/common.bundle.js",
            currHost + "/components/myApp." + pagePath + ".bundle.js"
        ], document);
    }, document);
}, document);

getScript/getAsset 方法将这些文件添加到 HTML 中。效果很好。

但经过检查,我很好奇我是否需要moment.min.js,如果我使用的是moment-with-locales.js,对吗?

如果是的话,我可以把它放在哪里。除了xxx.**.js 之外还有其他图书馆吗?

【问题讨论】:

  • 如果您已经使用 moment-with-locales.js,则不需要 moment.min.js

标签: javascript angularjs momentjs


【解决方案1】:

Moment-with-locales.js 是时刻,添加了语言环境 ;-)。所以你不需要moment-min.js。查看脚本列表,其他的似乎不需要momentjs。不过话说回来,momentjs 和 jQuery 一样基础,为什么不把它放在最前面呢?

【讨论】:

    猜你喜欢
    • 2019-03-04
    • 2016-11-07
    • 2020-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多