Skip to content

Instantly share code, notes, and snippets.

@narenaryan
Last active November 12, 2016 04:48
Show Gist options
  • Select an option

  • Save narenaryan/92d7ea11d91407be3cc2179b71e3cc0c to your computer and use it in GitHub Desktop.

Select an option

Save narenaryan/92d7ea11d91407be3cc2179b71e3cc0c to your computer and use it in GitHub Desktop.
app.controller('MainController', function($scope, $http, dataService) {
$scope.data = dataService.UIData;
$scope.addBorderedTableRow = function(data) {
$scope.data.BorderedTable.push(data);
var req = {
method: 'POST',
url: 'http://posturl',
headers: {
'Content-Type': "application/json"
},
data: {
BorderedTable: $scope.data.BorderedTable
}
};
$http(req).then(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
}, function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment