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);
});
};
}]);