app.controller('uploadCtrl', function ($scope, $http,video,notify) { $scope.profesor=""; $scope.texto1=""; $scope.texto2=""; $scope.video = video; $scope.diapos = []; $scope.profesores = []; function getProf(){ $http.get("https://plataforma.especificosba.com.ar/back/getAllProfesores.php?auth_token=4b494d6c7ffc74d387d8cfdef8ca1691").then( function(data){ $scope.profesores = data.data; }, function(data){ }); } getProf(); $scope.post = function() { var data = { prof: $scope.profesor, texto1: $scope.texto1, texto2: $scope.texto2, id: $scope.video._id, diapos: diapos }; $http.post('/back/upload/', data) .success(function(data,state) { notify({message:data.status,classes:"alert"}); }) .error(function(data) { notify({message:data.status,classes:"alert alert-danger"}); }); }; });