I am implementing a sample from the instruction of Dan Wahlin. I encountered same problem as this guy, I have tried his solution and investigated through my source code but there is not any redefinition of the module.
Here is my code
// main.js
require.config({
baseUrl: '/app/',
urlArgs: 'v=1.0'
});
require(
[
'config/myapp',
..... [dependencies]
],
function () {
angular.bootstrap(document, ['myApp']);
});
// myapp.js
'use strict';
define(['services/routeResolver'], function () {
var app = angular.module('myApp', ['ngRoute', 'ngAnimate', 'routeResolverServices', 'ui.bootstrap', 'breeze.angular']);
console.log('A'); //working
app.config(['$routeProvider', function($routeProvider){
console.log('C'); // this line does not work
}]);
console.log('B'); //working
app.run(['$rootScope',
function ($rootScope) {
}]);
return app;
});
I can do console.log
to print 'A', 'B'; but 'C' is not printed out, it is indicating that the function inside .config
does not work.
Any help is highly appreciated. Thank you!