1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 02:36:36 +00:00

refactor build config

This commit is contained in:
Rokt33r
2015-06-21 02:40:06 +09:00
parent 9e53bec631
commit 25eccacb4c
81 changed files with 6418 additions and 450 deletions

View File

@@ -0,0 +1,36 @@
/* global angular */
angular.module('codexen')
.controller('SideNavController', function ($auth, User, $rootScope, $scope) {
var vm = this
vm.isAuthenticated = $auth.isAuthenticated()
var reloadUser = function () {
if (vm.isAuthenticated) {
User.me().success(function (data) {
console.log('currentUser', data)
vm.currentUser = data
})
}
}
reloadUser()
vm.signOut = function () {
$auth.logout()
.then(function () {
console.log('Sign Out')
$rootScope.$broadcast('userSignOut')
})
}
$scope.$on('userSignIn', function () {
vm.isAuthenticated = true
reloadUser()
})
$scope.$on('userSignOut', function () {
vm.isAuthenticated = false
vm.currentUser = null
})
})