-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
executable file
·90 lines (84 loc) · 2.35 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Ionic Starter App, v0.9.20
// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic', 'starter.services', 'starter.controllers'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
})
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "menu.html",
controller: 'AppCtrl'
})
.state('app.search', {
url: "/search",
views: {
'menuContent' :{
templateUrl: "search.html",
controller: 'PlaylistsCtrl',
resolve: {
playlists: function(PlaylistsService) {
return PlaylistsService.getPlaylists()
}
}
}
}
})
.state('app.browse', {
url: "/browse",
views: {
'menuContent' :{
templateUrl: "browse.html"
}
}
})
.state('app.playlists', {
url: "/playlists",
views: {
'menuContent': {
templateUrl: "playlists.html",
controller: 'PlaylistsCtrl',
resolve: {
playlists: function(PlaylistsService) {
return PlaylistsService.getPlaylists()
}
}
}
}
})
.state('app.playlist', {
url: "/playlists/:playlistId",
views: {
'menuContent': {
templateUrl: "playlists.playlist.html",
controller: 'PlaylistCtrl',
resolve: {
playlist: function($stateParams, PlaylistsService) {
return PlaylistsService.getPlaylist($stateParams.playlistId)
}
}
}
}
})
.state('app.single', {
url: "/playlists/:playlistId/:singleId",
views: {
'menuContent': {
templateUrl: "playlists.playlist.single.html",
controller: 'SingleCtrl'
}
}
});
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/app/search');
});