app.controller('uploadCtrl', function ($scope, $http,video,notify) { $scope.profesor=""; $scope.texto1=""; $scope.texto2=""; $scope.video = video; $scope.post = function() { var data = { prof: $scope.profesor, texto1: $scope.texto1, texto2: $scope.texto2, id: $scope.video._id }; $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"}); }); }; });