-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.js
55 lines (47 loc) · 1.39 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
var env = {};
// Import variables if present (from env.js)
if(window){
Object.assign(env, window.__env);
}
var webapp = angular.module('webapp', [
'ngRoute',
'ngMaterial',
'ngMessages',
'ngProgress',
'LocalStorageModule'
]);
webapp.filter('escape', function() {
return function(input) {
if(input) {
return window.encodeURIComponent(input);
}
return "";
}
});
webapp.config([
'$routeProvider',
'$locationProvider',
'$mdThemingProvider',
'$mdIconProvider',
'localStorageServiceProvider',
function($routeProvider, $locationProvider, $mdThemingProvider, $mdIconProvider, localStorageServiceProvider, $location) {
$routeProvider.when('/', {
templateUrl: "views/homepage.html",
controller: "HomeController"
}).when('/recipes', {
templateUrl: 'views/recipes.html',
controller: 'RecipeController'
}).when('/recipes/:id', {
templateUrl: 'views/recipeDetails.html',
controller: 'RecipeDetailsController'
}).otherwise({
redirectTo: "/"
});
$locationProvider.html5Mode(true);
$mdThemingProvider.theme('default')
.primaryPalette('deep-purple')
.accentPalette('green')
.warnPalette('deep-orange');
localStorageServiceProvider.setPrefix('webapp');
}
]);