uploadCtrl.js 542 B

1234567891011121314151617181920212223
  1. app.controller('uploadCtrl', function ($scope, $http,video,notify) {
  2. $scope.profesor="";
  3. $scope.texto1="";
  4. $scope.texto2="";
  5. $scope.video = video;
  6. $scope.post = function() {
  7. var data = {
  8. prof: $scope.profesor,
  9. texto1: $scope.texto1,
  10. texto2: $scope.texto2,
  11. id: $scope.video._id
  12. };
  13. $http.post('/back/upload/', data)
  14. .success(function(data,state) {
  15. notify({message:data.status,classes:"alert"});
  16. })
  17. .error(function(data) {
  18. notify({message:data.status,classes:"alert alert-danger"});
  19. });
  20. };
  21. });