首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在需求(autobahn和to )中正确加载依赖项

在需求(autobahn和to )中正确加载依赖项
EN

Stack Overflow用户
提问于 2013-10-16 15:58:56
回答 2查看 836关注 0票数 1

在过去的几个小时里,我一直被困在这个问题上。我正在尝试获得autobahnjs,以及什么时候by需要正确加载。

代码语言:javascript
复制
require.config({
    paths: {
        angular:            '../bower_components/angular/angular',
        angularBootstrap:   '../bower_components/angular-bootstrap/ui-bootstrap',
        bootstrap:          '../bower_components/bootstrap/dist/js/bootstrap',
        jquery:             '../bower_components/jquery/jquery',
        chosen:             '../bower_components/chosen/chosen.jquery.min',
        text:               '../bower_components/requirejs-text/text',
        autobahn:           '../bower_components/autobahnjs/autobahn/autobahn'

    },
    packages: [
       { name: 'when', location: '../bower_components/when/', main: 'when' }
    ],
    baseUrl: '/bundles/example/app/scripts/',
    shim: {
        angular : { 
            exports : 'angular'
        },
        angularBootstrap: {
            deps: ['angular']
        },
        autobahn: {
            deps: ['when']
        }
    },
    priority: [
        'angular'
    ]
});

require
( [
    'angular',
    'app',
    'autobahn',
    'angularBootstrap',
    'jquery',
    'bootstrap',
    'chosen',
    'controllers/event',
    'services/notify'
], function(angular, app) {
    // more code here
});

Autobahnjs依赖于on。所有文件都被加载(并且顺序正确)。但什么时候总是不确定。我完全不知道我做错了什么。我试过各种各样的方法来解决这个问题。如果这可以帮助任何人复制问题,我也有一个bower.json文件。提前谢谢。

编辑:Autobahnjs目前不支持AMD.然而,当人们支持它的时候。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-10-28 12:39:58

现在这是0.8.0版本中的实施

票数 0
EN

Stack Overflow用户

发布于 2013-10-16 18:43:42

正如您已经注意到的,在AutobahnJS中添加需求支持存在一个问题。为了“方便”,AutobahnJS中也有更多的嵌入式内容,主要来自加密is。

所面临的挑战只是:如何最好地为所有用户服务,而不管他们是否使用和使用了什么模块加载器,如果他们想要方便(捆绑的东西),或者更愿意单独使用(以及管理/加载它们自己)。

我不能保证,但我会优先处理这件事。然而,对于进一步的讨论,我认为最好的地方是GitHub问题。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19408177

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档