uploadCtrl.js 843 B

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