Answer the question
In order to leave comments, you need to log in
Why then(...).error is not a function?
app.js
var app = angular.module('tcpdumpApp', ['lumx']);
app.controller('TcpdumpController', ['$scope', 'LxNotificationService', '$http', '$log', function($scope, LxNotificationService, $http, $log) {
$scope.newGenerationCommand = '';
$scope.tcpdumplists = [];
$scope.parametrs = '';
$scope.newPort = '';
$scope.newHost = '';
$scope.addTcpdumpTask = function() {
$http.post('/anguler-tasks-tcpdump2/addData.php',{genCommand:$scope.newGenerationCommand, description:$scope.newDescription})
.then(function(response) {
$scope.notify('success','Команда "' + response.data[0].command + '" успешно сгенерирована!');
$scope.tcpdumplists.push({
id: response.data[0].id,
command: response.data[0].command,
description: response.data[0].description,
completed: response.data[0].completed
});
})
.error(function(err){
$log.error(err);
});
};
}]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question