app.js 690 B

123456789101112131415161718192021222324252627
  1. var app = angular.module('app', ['ngRoute', 'ngSanitize', 'ngResource', 'ui.bootstrap']);
  2. app.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
  3. $locationProvider.html5Mode(true);
  4. $routeProvider
  5. .when('/', {
  6. templateUrl: 'modules/main/main.html',
  7. controller: 'mainCtrl'
  8. })
  9. .when('/artists', {
  10. templateUrl: 'modules/artists/artists.html',
  11. controller: 'artistListCtrl',
  12. resolve: {
  13. artists: function(ArtistsService){
  14. return ArtistsService.getAllArtistsWithAlbums();
  15. }
  16. }
  17. })
  18. .when('/albums', {
  19. templateUrl: 'modules/albums/albums.html',
  20. controller: 'albumListCtrl'
  21. })
  22. .otherwise({
  23. redirectTo: '/'
  24. });
  25. }]);