var app = angular.module('app', ['ngRoute', 'ngSanitize', 'ngResource', 'ui.bootstrap']); app.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $routeProvider .when('/', { templateUrl: 'modules/main/main.html', controller: 'mainCtrl' }) .when('/artists', { templateUrl: 'modules/artists/artists.html', controller: 'artistListCtrl', resolve: { artists: function(ArtistsService){ return ArtistsService.getAllArtistsWithAlbums(); } } }) .when('/albums', { templateUrl: 'modules/albums/albums.html', controller: 'albumListCtrl' }) .otherwise({ redirectTo: '/' }); }]);