I'm currently learning Angular and having trouble with my routing setup in my application. I have a complex structure of nested modules, which makes me believe the issue lies within the injections. If anyone could provide some guidance, it would greatly help alleviate my frustration.
Here are the module definitions:
application.js
'use strict';
var mainApplicationModuleName = 'vre';
var mainApplicationModule = angular.module(mainApplicationModuleName, ['ngResource', 'ngRoute', 'main']);
mainApplicationModule.config(['$locationProvider',
function($locationProvider){
$locationProvider.hashPrefix('!');
}
]);
if(window.location.hash === '#_=_'){
window.location.hash = '#!';
}
angular.element(document).ready(function(){
angular.bootstrap(document, [mainApplicationModuleName]);
});
main module
angular.module('main', ['administrator']);
administrator profile
'use strict';
angular.module('administrator', ['accountManagement']);
account management module
'use strict';
angular.module('accountManagement', ['ngRoute']);
The routing setup is as follows:
angular.module('accountManagement').config(['$routeProvider', function($routeProvider){
alert("hello");
$routeProvider
.when('/accounts/:accountId', {
templateUrl: 'administrator/account_management/views/view_account.client.view.html'
});
}]);
Although the alert pops up, when I navigate to the URL, I receive the error message "Cannot GET /accounts/55889e12c02081fc20de1bdd". Any assistance would be highly appreciated.
Thank you,
Ash