diff options
author | Michaël Ball <michael.ball@gmail.com> | 2014-12-28 12:24:22 +0000 |
---|---|---|
committer | Michaël Ball <michael.ball@gmail.com> | 2015-11-27 20:02:04 +0000 |
commit | 75beec91a8526fbbc0a90134140b9dff6af15c0c (patch) | |
tree | 02414e46da3e08000384c40c27b7aab9748de0fe /static/scripts/app/app.js | |
parent | a2964845e3c03b9cf5f01583f53f7553c7d67caf (diff) |
Initial frontend work
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 |