Last active
November 12, 2016 04:48
-
-
Save narenaryan/92d7ea11d91407be3cc2179b71e3cc0c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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