Update sidebar and navbar buttons
This commit is contained in:
@@ -5,8 +5,8 @@
|
|||||||
.module('app')
|
.module('app')
|
||||||
.controller('NavbarCtrl', NavbarCtrl)
|
.controller('NavbarCtrl', NavbarCtrl)
|
||||||
|
|
||||||
NavbarCtrl.$inject = ['$scope', 'authentication', '$state', 'professors'];
|
NavbarCtrl.$inject = ['$scope', 'authentication', '$state', 'professors', 'data'];
|
||||||
function NavbarCtrl($scope, authentication, $state, professors) {
|
function NavbarCtrl($scope, authentication, $state, professors, data) {
|
||||||
var vm = this;
|
var vm = this;
|
||||||
var user = authentication.currentUser();
|
var user = authentication.currentUser();
|
||||||
var professorid = user._id;
|
var professorid = user._id;
|
||||||
@@ -19,11 +19,14 @@
|
|||||||
console.log("Error al obtener los datos.");
|
console.log("Error al obtener los datos.");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
vm.profile = function (){
|
||||||
|
data.professorId = professorid;
|
||||||
|
$state.go('ProfessorUpdate');
|
||||||
|
};
|
||||||
|
|
||||||
vm.logout = function () {
|
vm.logout = function () {
|
||||||
authentication.logout();
|
authentication.logout();
|
||||||
$state.go('login');
|
$state.go('login');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
@@ -16,6 +16,13 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<br>
|
<br>
|
||||||
<span>Bienvenido(a)! Profesor(a) {{vm.professor.lastname}}</span>
|
<span>Bienvenido(a)! Profesor(a) {{vm.professor.lastname}}</span>
|
||||||
|
<button class="btn-primary btn"
|
||||||
|
style=" margin: 10px"
|
||||||
|
ng-click= "vm.profile()">
|
||||||
|
<span class="glyphicon glyphicon-user"
|
||||||
|
aria-hidden="true"></span>
|
||||||
|
Mi Perfil
|
||||||
|
</button>
|
||||||
<button class="btn-danger btn"
|
<button class="btn-danger btn"
|
||||||
style=" margin: 10px"
|
style=" margin: 10px"
|
||||||
ng-click= "vm.logout()">
|
ng-click= "vm.logout()">
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
{
|
{
|
||||||
state: 'ProfessorCreate',
|
state: 'ProfessorCreate',
|
||||||
text: 'Nuevo Profesor'
|
text: 'Nuevo Profesor'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user