在过去的几个小时里,我一直被困在这个问题上。我正在尝试获得autobahnjs,以及什么时候by需要正确加载。
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.然而,当人们支持它的时候。
发布于 2013-10-28 12:39:58
现在这是0.8.0版本中的实施
发布于 2013-10-16 18:43:42
正如您已经注意到的,在AutobahnJS中添加需求支持存在一个问题。为了“方便”,AutobahnJS中也有更多的嵌入式内容,主要来自加密is。
所面临的挑战只是:如何最好地为所有用户服务,而不管他们是否使用和使用了什么模块加载器,如果他们想要方便(捆绑的东西),或者更愿意单独使用(以及管理/加载它们自己)。
我不能保证,但我会优先处理这件事。然而,对于进一步的讨论,我认为最好的地方是GitHub问题。
https://stackoverflow.com/questions/19408177
复制相似问题