uploadCtrl.js 862 B

123456789101112131415161718192021222324252627282930313233343536
  1. app.controller('uploadCtrl', function ($scope, $http,video,notify) {
  2. $scope.profesor="";
  3. $scope.texto1="";
  4. $scope.texto2="";
  5. $scope.video = video;
  6. $scope.diapos = [];
  7. $scope.profesores = [];
  8. function getProf(){
  9. $http.get("https://plataforma.especificosba.com.ar/back/getAllProfesores.php?auth_token=4b494d6c7ffc74d387d8cfdef8ca1691").then(
  10. function(data){
  11. $scope.profesores = data.data;
  12. },
  13. function(data){
  14. });
  15. }
  16. getProf();
  17. $scope.post = function() {
  18. var data = {
  19. prof: $scope.profesor,
  20. texto1: $scope.texto1,
  21. texto2: $scope.texto2,
  22. id: $scope.video._id,
  23. diapos: diapos
  24. };
  25. $http.post('/back/upload/', data)
  26. .success(function(data,state) {
  27. notify({message:data.status,classes:"alert"});
  28. })
  29. .error(function(data) {
  30. notify({message:data.status,classes:"alert alert-danger"});
  31. });
  32. };
  33. });