Update sidebar and navbar buttons

This commit is contained in:
Reynaldo Reyes
2016-06-07 22:46:40 -04:00
parent a904766db6
commit 68edae2ed0
3 changed files with 15 additions and 5 deletions

View File

@@ -5,8 +5,8 @@
.module('app')
.controller('NavbarCtrl', NavbarCtrl)
NavbarCtrl.$inject = ['$scope', 'authentication', '$state', 'professors'];
function NavbarCtrl($scope, authentication, $state, professors) {
NavbarCtrl.$inject = ['$scope', 'authentication', '$state', 'professors', 'data'];
function NavbarCtrl($scope, authentication, $state, professors, data) {
var vm = this;
var user = authentication.currentUser();
var professorid = user._id;
@@ -19,11 +19,14 @@
console.log("Error al obtener los datos.");
});
vm.profile = function (){
data.professorId = professorid;
$state.go('ProfessorUpdate');
};
vm.logout = function () {
authentication.logout();
$state.go('login');
};
};
})();