-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
92 lines (84 loc) · 2.26 KB
/
app.js
File metadata and controls
92 lines (84 loc) · 2.26 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
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
91
92
var app=angular.module("app",['ngRoute','ngCookies'])
app.config(function($routeProvider){
$routeProvider
.when('/register',{
templateUrl:'_user/registerUser.html',
controller:'UserController'
})
.when('/login',{
templateUrl:'_user/login.html',
controller:'UserController'
})
.when('/home',{
templateUrl:'_home/home.html'
})
.when('/profilepic',{
templateUrl:'_user/ProfilePic.html'
})
.when('/edituser',{
templateUrl:'_user/edituserform.html',
controller:'EditController'
})
.when('/jobpost',{
templateUrl:'job/jobform.html',
controller:'JobController'
})
.when('/getAllJobs',{
templateUrl:'job/getjobtitles.html',
controller:'JobController'
})
.when('/blogpost',{
templateUrl:'blog/blogform.html',
controller:'BlogController'
})
.when('/getAllBlogs',{
templateUrl:'blog/getBlogTitles.html',
controller:'BlogController'
})
.when('/getBlogDetail/:id',{
templateUrl:'blog/blogdetail.html',
controller:'BlogDetailController'
})
.when('/getBlogForApproval/:id',{
templateUrl:'blog/getBlogForApproval.html',
controller:'BlogDetailController'
})
.when('/getAllUsers',{
templateUrl:'friend/userslist.html',
controller:'FriendController'
})
.when('/pendingRequests',{
templateUrl:'friend/pendingrequests.html',
controller:'FriendController'
})
.when('/friendslist',{
templateUrl:'friend/listOfFriends.html',
controller:'FriendController'
})
.when('/chat',{
templateUrl:'chat/chat.html',
controller:'ChatController'
})
})
app.run(function($rootScope,$cookieStore,UserService,$location){
console.log('entering run method ')
console.log($rootScope.currentUser)
if($rootScope.currentUser==undefined){
$rootScope.currentUser=$cookieStore.get("currentUser")
console.log($rootScope.currentUser)
}
$rootScope.logout=function(){
console.log('logout function')
delete $rootScope.currentUser;
$cookieStore.remove('currentUser')
UserService.logout()
.then(function(response){
console.log("logged out successfully..");
$rootScope.message="Loggedout Successfully"
$location.path('/login')
},
function(response){
console.log(response.status);
})
}
})