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?
4

0 回答 0