I'm implementing AngularJS + RequireJs through AngularAMD.
I want to add the Jquery library but it returns the following error when I use "$":
Error: $ is not defined
I have main.js set up as follows:
require.config({
baseUrl: "js/",
// alias libraries paths
paths: {
'angular': 'libs/angular.min',
'angular-route': 'libs/angular-route.min',
'angular-ui-router': 'libs/angular-ui-router.min',
'angularAMD': 'libs/angularAMD',
'jquery': '//code.jquery.com/jquery-1.11.2.min.js',
'jquery-migrate': '//code.jquery.com/jquery-migrate-1.2.1.min.js'
},
// Add angular modules that does not support AMD out of the box, put it in a shim
shim: {
'angular-route': [ 'angular' ],
'angularAMD': [ 'angular' ],
'angular-ui-router': [ 'angular' ]
},
// kick start application
deps: ['app']
});
What's wrong?