I am using AngularJS alongside RequireJS, but I can't get my app to work properly. When I look in the AngularJS dev tools, it shows the following messages:
Module "ngRoute" was created but never loaded.
Module "Welfordian" was created but never loaded.
Here are my scripts
Main.JS
require.config({
baseUrl: "assets/js",
paths: {
'angular': '//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min',
'angularAMD': 'angularAMD',
'ngload': 'ngload',
'ngRoute': 'angular-route'
},
shim: {
'angularAMD': ['angular'],
'ngload': ['angularAMD']
},
deps: ['app']
});
App.JS
define(['angularAMD', 'ngRoute'], function (angularAMD, ngRoute) {
var app = angular.module('Welfordian', ['ngRoute']);
app.config(function ($routeProvider) {
$routeProvider.when(
"/home",
angularAMD.route({
templateUrl: 'views/home.html',
controller: 'HomeController',
controllerUrl: 'controllers'
})
).otherwise({redirectTo: '/home'});
});
return angularAMD.bootstrap(app);
});