|
| 1 | +angular.module('students') |
| 2 | + .controller('studentsProfileController',function($scope, $resource, $stateParams, $mdDialog, StudentsService){ |
| 3 | + |
| 4 | + var vm = this; |
| 5 | + |
| 6 | + vm.studentId = $stateParams.studentId |
| 7 | + |
| 8 | + // Functions associations |
| 9 | + //vm.addRelation = addRelation; |
| 10 | + |
| 11 | + vm.defaultAvatar = 'https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcThQiJ2fHMyU37Z0NCgLVwgv46BHfuTApr973sY7mao_C8Hx_CDPrq02g' |
| 12 | + |
| 13 | + |
| 14 | + vm.student = StudentsService.get({id: vm.studentId}, function(){ |
| 15 | + console.log(vm.student) |
| 16 | + |
| 17 | + }, function(){ |
| 18 | + console.log('Student not found') |
| 19 | + vm.student = null; |
| 20 | + }) |
| 21 | + |
| 22 | + /* |
| 23 | + vm.teacherSubjects = StudentsService.getSubjects({id: vm.teacherId}, function(){ |
| 24 | + console.log('Teachers subjects') |
| 25 | + console.log(vm.teacherSubjects) |
| 26 | + }) |
| 27 | +
|
| 28 | + vm.teacherClasses = StudentsService.getClasses({id: vm.teacherId}, function(){ |
| 29 | + console.log('Teachers classes') |
| 30 | + console.log(vm.teacherClasses) |
| 31 | + }) |
| 32 | + */ |
| 33 | + |
| 34 | + /* |
| 35 | + vm.teacher = { |
| 36 | + "name": "El nombre", |
| 37 | + "surname": "Los apellidos", |
| 38 | + "locality": "Granada", |
| 39 | + "email": "correo@gmail.com", |
| 40 | + "asignaturas":{ |
| 41 | + "num": 2, |
| 42 | + "items": [{ |
| 43 | + "name": "francés", |
| 44 | + "idAsignatura": 324 |
| 45 | + },{ |
| 46 | + "name": "francés", |
| 47 | + "idAsignatura": 324 |
| 48 | + } |
| 49 | + ] |
| 50 | + } |
| 51 | + }*/ |
| 52 | + |
| 53 | + activate(); |
| 54 | + |
| 55 | + /////////////////////////////////////////////////////////// |
| 56 | + function activate() { |
| 57 | + console.log('Activating studentsProfileController controller.') |
| 58 | + |
| 59 | + } |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + /** |
| 64 | + * Open the dialog to add a relation to this teacher. |
| 65 | + * The add action is done in addUserToProjectController |
| 66 | +
|
| 67 | + function addRelation() { |
| 68 | +
|
| 69 | + $mdDialog.show({ |
| 70 | + locals: {parentScope: $scope, parentController: vm}, |
| 71 | + controller: 'addRelationController', |
| 72 | + controllerAs: 'vm', |
| 73 | + templateUrl: 'app/views/teaching/utils/addRelationTemplate.html' |
| 74 | + }) |
| 75 | + .then(function () { |
| 76 | +
|
| 77 | + }, function () { |
| 78 | +
|
| 79 | + }); |
| 80 | + }*/ |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +}); |
0 commit comments