12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- eval.directive('ngConfirmClick', [
- function(){
- return {
- link: function (scope, element, attr) {
- var msg = attr.ngConfirmClick || "Are you sure?";
- var clickAction = attr.confirmedClick;
- element.bind('click',function (event) {
- if ( window.confirm(msg) ) {
- scope.$eval(clickAction)
- }
- });
- }
- };
- }]);
-
- eval.controller('evalController', function evalController($http, $scope){
-
- $scope.evaluaciones = evaluaciones
-
-
-
-
- $scope.operacion = "Añadir" ;
-
- var teacherId = document.getElementById('maestroId').value;
- var ofertaId = document.getElementById('ofertaId').value;
-
- $scope.submitForm = function() {
- path ="/Maestro/"+teacherId+"/" +ofertaId;
-
- if ($scope.operacion =="Actualizar"){
- path += "/editar"
- }
- else{
- path += "/addNota"
- }
- $http.post(path, $scope.eval);
-
- }
-
- $scope.edit = function(key){
-
-
- $scope.eval = evaluaciones[key];
- $scope.operacion ='Actualizar';
-
- }
-
- $scope.anadir = function (){
- $scope.eval = {};
- $scope.operacion = 'Añadir';
- }
-
-
- });
|