search

Home  >  Q&A  >  body text

angular.js - The amd module processed by grunt is not loaded in angular. How to solve it?

I processed all amd modules with grunt-contrib-requirejs and got the same number of min.js files as before, and then require-concat all these files.
Then I tried to directly load the file after requirejs.config()concat without using . I found that it didn’t work. The angular module was not loaded in the browser’s Network, so I changed the original requirejs.config() (below) to After adding it again, I found that the angular module was still not loaded in the Network

requirejs.config({
    baseUrl:'scripts',
    paths:{
        "angular":"//cdn.bootcss.com/angular.js/1.3.14/angular.min",
        "angular-touch":"//cdn.bootcss.com/angular.js/1.3.14/angular-touch.min",

    },
    shim:{
        'angular': {
          exports: 'angular'
        },
        'angular-touch': {
            deps:['angular'],
            exports: 'angular-touch'
        }
    }
});

How should this situation be handled so that the original dependencies of the program are loaded correctly and the app can run normally?

淡淡烟草味淡淡烟草味2792 days ago744

reply all(1)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-15 16:57:54

    Check whether the path configuration is correct.

    reply
    0
  • Cancelreply