Guest User

Untitled

a guest
Oct 29th, 2015
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <button ng-click="addSoft()">Add project</button>
  2.  
  3. $scope.addSoft = function () {
  4.         var fd = new FormData();
  5.  
  6.             fd.append('data', 'angular+laravel');
  7.  
  8.         $http.post('path', fd, {
  9.             transformRequest: angular.identity,
  10.             headers: {
  11.                 'Content-Type': undefined
  12.             }
  13.         }).success(function (response) {
  14.             console.log(response); // angular+laravel
  15.         });
  16.  
  17. public function addSoft(Request $request)
  18.     {
  19.  
  20.         $data = $request->get('data');
  21.         return $data;
  22.  
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment