-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAppConfig.js
More file actions
60 lines (51 loc) · 1.58 KB
/
AppConfig.js
File metadata and controls
60 lines (51 loc) · 1.58 KB
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
/**
* Created by Sahil Jain on 16/08/2014.
*/
var app = angular.module("mainApp");
app.config(function ($routeProvider) {
$routeProvider.when('/login', {
templateUrl: 'login-form.html',
controller: 'loginFormController',
title: 'Login to Waterloo Answers'
});
$routeProvider.when('/signup', {
templateUrl: 'signup.html',
controller: 'signUpController',
title: 'Sign Up for Waterloo Answrs'
});
$routeProvider.when('/', {
templateUrl: 'questions.html',
controller: 'questionsController',
title: 'View Questions'
});
$routeProvider.when('/ask', {
templateUrl: 'askquestion.html',
controller: 'askController',
title: 'Ask a Question'
});
$routeProvider.when('/question/:questionId', {
templateUrl: 'singlequestion.html',
controller: 'questionController',
title: 'Waterloo Answers'
});
$routeProvider.when('/categories', {
templateUrl: 'category.html',
controller: 'categoryController',
title: 'Waterloo Answers'
});
$routeProvider.when('/profile', {
templateUrl: 'profile.html',
controller: 'profileController',
title: 'Your Profile'
});
$routeProvider.otherwise({
redirectTo: '/'
});
});
app.run(['$location', '$rootScope', function ($location, $rootScope) {
$rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
if (current.hasOwnProperty('$$route')) {
$rootScope.title = current.$$route.title;
}
});
}]);