Durandal冗余路径和模块定义

时间:2014-03-05 07:27:14

标签: javascript knockout.js requirejs durandal durandal-2.0

为什么我需要命名路径,并再次定义模块,这不是多余的吗?

requirejs.config({
    paths: {
        'text': '../Scripts/text',
        'durandal': '../Scripts/durandal',
        'plugins': '../Scripts/durandal/plugins',
        'transitions': '../Scripts/durandal/transitions',
        'knockout': '../Scripts/knockout-2.3.0',
        'jquery' : '../Scripts/jquery-1.9.1,'
    }
})


//Didn't we already define the route "jquery" to point tot he AMD module above? 
//So why are we repeating this, by defining the jQuery to point to a global function?  
define('jquery', function() { return jQuery; }); 
define('knockout', ko); //The example won't run without this, but why?

0 个答案:

没有答案