diff options
Diffstat (limited to 'static/scripts/app/app.js')
-rw-r--r-- | static/scripts/app/app.js | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/static/scripts/app/app.js b/static/scripts/app/app.js new file mode 100644 index 0000000..b0d3738 --- /dev/null +++ b/static/scripts/app/app.js @@ -0,0 +1,63 @@ +var mach2App = angular.module( + 'mach2App', + [ + 'ui.router', + 'mach2Services', + 'mach2Controllers', + 'mach2Filters', + 'ui.bootstrap', + 'angularMoment' + ] +); + +mach2App.config( + [ + '$stateProvider', + '$urlRouterProvider', + function($stateProvider, $urlRouterProvider) { + $stateProvider.state('artists', { + url: '/artists', + templateUrl: 'static/partials/artists/list.html', + controller: 'ArtistCtrl', + }); + + $stateProvider.state('artistdetail', { + url: '/artists/{artistId:int}', + templateUrl: 'static/partials/artists/detail.html', + controller: 'ArtistDetailCtrl', + resolve: { + artistId: ['$stateParams', function($stateParams) { + return $stateParams.artistId; + }] + }, + }); + + $stateProvider.state('artistdetail.tracks', { + url: '/tracks', + templateUrl: 'static/partials/artists/tracks.html', + controller: 'ArtistTracksCtrl' + }); + + $stateProvider.state('albums', { + url: '/albums', + templateUrl: 'static/partials/albums/list.html', + controller: 'AlbumCtrl' + }); + + $stateProvider.state('albums.detail', { + url: '/{albumId:int}', + templateUrl: 'static/partials/album/detail.html', + controller: 'AlbumDetailCtrl' + }); + + $urlRouterProvider.otherwise('/artists'); + } + ] +); + +mach2App.constant( + 'angularMomentConfig', + { + timezone: 'utc' + } +);
\ No newline at end of file |